[pypy-svn] r69872 - pypy/branch/virtual-forcing/pypy/jit/metainterp/test

arigo at codespeak.net arigo at codespeak.net
Thu Dec 3 18:04:10 CET 2009


Author: arigo
Date: Thu Dec  3 18:04:09 2009
New Revision: 69872

Modified:
   pypy/branch/virtual-forcing/pypy/jit/metainterp/test/test_vref.py
Log:
Adding the second test, skipped.


Modified: pypy/branch/virtual-forcing/pypy/jit/metainterp/test/test_vref.py
==============================================================================
--- pypy/branch/virtual-forcing/pypy/jit/metainterp/test/test_vref.py	(original)
+++ pypy/branch/virtual-forcing/pypy/jit/metainterp/test/test_vref.py	Thu Dec  3 18:04:09 2009
@@ -1,3 +1,4 @@
+import py
 from pypy.rlib.jit import JitDriver, dont_look_inside, virtual_ref
 from pypy.jit.metainterp.test.test_basic import LLJitMixin, OOJitMixin
 
@@ -29,6 +30,35 @@
         self.meta_interp(f, [15])
         self.check_loops(new_with_vtable=0)
 
+    def test_simple_force_always(self):
+        py.test.skip("in-progress")
+        myjitdriver = JitDriver(greens = [], reds = ['n'])
+        #
+        class XY:
+            pass
+        class ExCtx:
+            pass
+        exctx = ExCtx()
+        #
+        @dont_look_inside
+        def externalfn(n):
+            m = exctx.topframeref().n
+            assert m == n
+            return 1
+        #
+        def f(n):
+            while n > 0:
+                myjitdriver.can_enter_jit(n=n)
+                myjitdriver.jit_merge_point(n=n)
+                xy = XY()
+                xy.n = n
+                exctx.topframeref = virtual_ref(xy)
+                n -= externalfn(n)
+                exctx.topframeref = None
+        #
+        self.meta_interp(f, [15])
+        self.check_loops(new_with_vtable=0)
+
 
 class TestLLtype(VRefTests, LLJitMixin):
     pass



More information about the Pypy-commit mailing list