[pypy-svn] r62846 - pypy/branch/pyjitpl5/pypy/jit/metainterp/test

fijal at codespeak.net fijal at codespeak.net
Wed Mar 11 11:56:11 CET 2009


Author: fijal
Date: Wed Mar 11 11:56:10 2009
New Revision: 62846

Modified:
   pypy/branch/pyjitpl5/pypy/jit/metainterp/test/test_virtualizable.py
Log:
a bit broken test, I admit, but should work anyway


Modified: pypy/branch/pyjitpl5/pypy/jit/metainterp/test/test_virtualizable.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/metainterp/test/test_virtualizable.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/metainterp/test/test_virtualizable.py	Wed Mar 11 11:56:10 2009
@@ -370,6 +370,30 @@
 
         res = self.meta_interp(f, [10], policy=StopAtXPolicy(g))
         assert res == f(10)
+
+    def test_read_after_loop(self):
+        py.test.skip("FIXME")
+        jitdriver = JitDriver(greens = [], reds = ['frame', 'n'],
+                              virtualizables = ['frame'])
+
+        class Frame(object):
+            _virtualizable2_ = True
+
+            def __init__(self, x):
+                self.x = x
+
+        def f(n):
+            frame = Frame(10)
+            while n > 0:
+                jitdriver.can_enter_jit(frame=frame, n=n)
+                jitdriver.jit_merge_point(frame=frame, n=n)
+                frame.x = hint(frame.x, promote=True)
+                n -= 1
+                frame.x += 1
+            return frame.x
+
+        res = self.meta_interp(f, [30])
+        assert res == f(10)
         
 
     def test_external_read(self):



More information about the Pypy-commit mailing list