[pypy-commit] pypy default: A failing test that shows a real (but rare) case in translation.

arigo noreply at buildbot.pypy.org
Sat Oct 1 12:38:47 CEST 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r47744:6b1ea446d303
Date: 2011-10-01 12:36 +0200
http://bitbucket.org/pypy/pypy/changeset/6b1ea446d303/

Log:	A failing test that shows a real (but rare) case in translation.

diff --git a/pypy/rlib/test/test_jit.py b/pypy/rlib/test/test_jit.py
--- a/pypy/rlib/test/test_jit.py
+++ b/pypy/rlib/test/test_jit.py
@@ -1,7 +1,7 @@
 import py
 from pypy.conftest import option
 from pypy.rlib.jit import hint, we_are_jitted, JitDriver, elidable_promote
-from pypy.rlib.jit import JitHintError, oopspec
+from pypy.rlib.jit import JitHintError, oopspec, isconstant
 from pypy.translator.translator import TranslationContext, graphof
 from pypy.rpython.test.tool import BaseRtypingTest, LLRtypeMixin, OORtypeMixin
 from pypy.rpython.lltypesystem import lltype
@@ -137,6 +137,16 @@
             t.view()
         # assert did not raise
 
+    def test_isconstant(self):
+        def f(n):
+            assert n >= 0
+            assert isconstant(n) is False
+            l = []
+            l.append(n)
+            return len(l)
+        res = self.interpret(f, [234])
+        assert res == 1
+
 
 class TestJITLLtype(BaseTestJIT, LLRtypeMixin):
     pass


More information about the pypy-commit mailing list