[pypy-svn] r53260 - pypy/branch/jit-hotpath/pypy/jit/rainbow/test

antocuni at codespeak.net antocuni at codespeak.net
Wed Apr 2 19:11:29 CEST 2008


Author: antocuni
Date: Wed Apr  2 19:11:28 2008
New Revision: 53260

Modified:
   pypy/branch/jit-hotpath/pypy/jit/rainbow/test/test_interpreter.py
Log:
port the last test_degenerated_* to ootype



Modified: pypy/branch/jit-hotpath/pypy/jit/rainbow/test/test_interpreter.py
==============================================================================
--- pypy/branch/jit-hotpath/pypy/jit/rainbow/test/test_interpreter.py	(original)
+++ pypy/branch/jit-hotpath/pypy/jit/rainbow/test/test_interpreter.py	Wed Apr  2 19:11:28 2008
@@ -2158,11 +2158,29 @@
         res = self.interpret(ll_function, [1], [])
         assert res.x == 3
 
+    def test_degenerated_via_substructure(self):
+        S = ootype.Instance('S', ootype.ROOT, {'x': lltype.Signed})
+        T = ootype.Instance('T', S, {'y': lltype.Float})
+
+        def ll_function(flag):
+            t = ootype.new(T)
+            t.x = 3
+            s = ootype.new(S)
+            s.x = 7
+            if flag:
+                pass
+            else:
+                s = ootype.ooupcast(S, t)
+            t.x += 1
+            return s.x * t.x
+        res = self.interpret(ll_function, [1], [])
+        assert res == 7 * 4
+        res = self.interpret(ll_function, [0], [])
+        assert res == 4 * 4
 
     def _skip(self):
         py.test.skip('in progress')
 
-    #test_degenerated_via_substructure = _skip
     test_plus_minus = _skip
     test_red_array = _skip
     test_red_struct_array = _skip


More information about the pypy-svn mailing list