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

fijal at codespeak.net fijal at codespeak.net
Thu Mar 12 17:21:19 CET 2009


Author: fijal
Date: Thu Mar 12 17:21:15 2009
New Revision: 62894

Modified:
   pypy/branch/pyjitpl5/pypy/jit/metainterp/test/test_basic.py
Log:
a test that fails for obscure reasons


Modified: pypy/branch/pyjitpl5/pypy/jit/metainterp/test/test_basic.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/metainterp/test/test_basic.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/metainterp/test/test_basic.py	Thu Mar 12 17:21:15 2009
@@ -5,6 +5,7 @@
 from pypy.jit.metainterp import support, codewriter, pyjitpl, history
 from pypy.jit.metainterp.policy import JitPolicy, StopAtXPolicy
 from pypy import conftest
+from pypy.rlib.rarithmetic import ovfcheck
 
 def get_metainterp(func, values, CPUClass, type_system, policy,
                    listops=False):
@@ -300,6 +301,16 @@
         res = self.interp_operations(f, [5])
         assert res == 17
 
+    def test_mod_ovf(self):
+        myjitdriver = JitDriver(greens = [], reds = ['n', 'x', 'y'])
+        def f(n, x, y):
+            while n > 0:
+                myjitdriver.can_enter_jit(x=x, y=y, n=n)
+                myjitdriver.jit_merge_point(x=x, y=y, n=n)
+                n -= ovfcheck(x % y)
+            return n
+        res = self.meta_interp(f, [20, 1, 2])
+        assert res == 0
 
 class TestOOtype(BasicTests, OOJitMixin):
     pass



More information about the Pypy-commit mailing list