[pypy-commit] pypy default: Test and fix: skip that test on 64-bit.

arigo noreply at buildbot.pypy.org
Thu Feb 23 14:42:22 CET 2012


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r52801:f3469e6103b2
Date: 2012-02-23 14:42 +0100
http://bitbucket.org/pypy/pypy/changeset/f3469e6103b2/

Log:	Test and fix: skip that test on 64-bit.

diff --git a/pypy/rlib/jit.py b/pypy/rlib/jit.py
--- a/pypy/rlib/jit.py
+++ b/pypy/rlib/jit.py
@@ -469,14 +469,16 @@
         # FLOATs.
         if len(self._heuristic_order) < len(livevars):
             from pypy.rlib.rarithmetic import (r_singlefloat, r_longlong,
-                                               r_ulonglong)
+                                               r_ulonglong, r_uint)
             added = False
             for var, value in livevars.items():
                 if var not in self._heuristic_order:
-                    if isinstance(value, (r_longlong, r_ulonglong)):
+                    if (r_ulonglong is not r_uint and
+                            isinstance(value, (r_longlong, r_ulonglong))):
                         assert 0, ("should not pass a r_longlong argument for "
-                                   "now, because on 32-bit machines it would "
-                                   "need to be ordered as a FLOAT")
+                                   "now, because on 32-bit machines it needs "
+                                   "to be ordered as a FLOAT but on 64-bit "
+                                   "machines as an INT")
                     elif isinstance(value, (int, long, r_singlefloat)):
                         kind = '1:INT'
                     elif isinstance(value, float):
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
@@ -2,6 +2,7 @@
 from pypy.conftest import option
 from pypy.rlib.jit import hint, we_are_jitted, JitDriver, elidable_promote
 from pypy.rlib.jit import JitHintError, oopspec, isconstant
+from pypy.rlib.rarithmetic import r_uint
 from pypy.translator.translator import TranslationContext, graphof
 from pypy.rpython.test.tool import BaseRtypingTest, LLRtypeMixin, OORtypeMixin
 from pypy.rpython.lltypesystem import lltype
@@ -178,6 +179,11 @@
                    myjitdriver.jit_merge_point, i1=42, r1=A(), r2=None, f1=3.5)
         assert "got ['2:REF', '1:INT', '2:REF', '3:FLOAT']" in repr(e.value)
 
+    def test_argument_order_accept_r_uint(self):
+        # this used to fail on 64-bit, because r_uint == r_ulonglong
+        myjitdriver = JitDriver(greens=['i1'], reds=[])
+        myjitdriver.jit_merge_point(i1=r_uint(42))
+
 
 class TestJITLLtype(BaseTestJIT, LLRtypeMixin):
     pass


More information about the pypy-commit mailing list