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

fijal at codespeak.net fijal at codespeak.net
Wed Mar 4 16:00:30 CET 2009


Author: fijal
Date: Wed Mar  4 16:00:30 2009
New Revision: 62529

Modified:
   pypy/branch/pyjitpl5/pypy/jit/metainterp/test/test_virtual.py
Log:
a strangely failing test


Modified: pypy/branch/pyjitpl5/pypy/jit/metainterp/test/test_virtual.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/metainterp/test/test_virtual.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/metainterp/test/test_virtual.py	Wed Mar  4 16:00:30 2009
@@ -168,6 +168,26 @@
         res = self.meta_interp(f, [20])
         assert res == 9
 
+    def test_immutable_constant_getfield(self):
+        myjitdriver = JitDriver(greens = [], reds = ['n'])
+
+        class Stuff(object):
+            _immutable_ = True
+            def __init__(self, x):
+                self.x = x
+
+        def f(n):
+            stuff = Stuff(1)
+            while n > 0:
+                myjitdriver.can_enter_jit(n=n)
+                myjitdriver.jit_merge_point(n=n)
+                n -= stuff.x
+            return n
+
+        res = self.meta_interp(f, [10])
+        assert n == 0
+        self.check_loops(getfield_gc=0)
+
 ##class TestOOtype(VirtualTests, OOJitMixin):
 ##    _new = staticmethod(ootype.new)
 



More information about the Pypy-commit mailing list