Commits

Armin Rigo committed 8e1b02e

Fix the places that used to write a number and expect a possibly
different one.

Comments (0)

Files changed (5)

pypy/module/pypyjit/test_pypy_c/test_00_model.py

             i8 = int_add(i4, 1)
             # signal checking stuff
             guard_not_invalidated(descr=...)
-            i10 = getfield_raw(37212896, descr=<.* pypysig_long_struct.c_value .*>)
+            i10 = getfield_raw(..., descr=<.* pypysig_long_struct.c_value .*>)
             i14 = int_lt(i10, 0)
             guard_false(i14, descr=...)
             jump(p0, p1, p2, p3, i8, descr=...)

pypy/module/pypyjit/test_pypy_c/test_call.py

             # make sure that the "block" is not allocated
             ...
             i20 = force_token()
-            p22 = new_with_vtable(19511408)
+            p22 = new_with_vtable(...)
             p24 = new_array(1, descr=<ArrayP .>)
             p26 = new_with_vtable(ConstClass(W_ListObject))
             setfield_gc(p0, i20, descr=<FieldS .*PyFrame.vable_token .*>)
             setfield_gc(p26, ConstPtr(ptr22), descr=<FieldP pypy.objspace.std.listobject.W_ListObject.inst_strategy .*>)
             setarrayitem_gc(p24, 0, p26, descr=<ArrayP .>)
             setfield_gc(p22, p24, descr=<FieldP .*Arguments.inst_arguments_w .*>)
-            p32 = call_may_force(11376960, p18, p22, descr=<Callr . rr EF=6>)
+            p32 = call_may_force(..., p18, p22, descr=<Callr . rr EF=6>)
             ...
         """)
 

pypy/module/pypyjit/test_pypy_c/test_misc.py

             p17 = getarrayitem_gc(p16, i12, descr=<ArrayP .>)
             i19 = int_add(i12, 1)
             setfield_gc(p9, i19, descr=<FieldS .*W_AbstractSeqIterObject.inst_index .*>)
-            guard_nonnull_class(p17, 146982464, descr=...)
+            guard_nonnull_class(p17, ..., descr=...)
             i21 = getfield_gc(p17, descr=<FieldS .*W_Array.*.inst_len .*>)
             i23 = int_lt(0, i21)
             guard_true(i23, descr=...)

pypy/module/pypyjit/test_pypy_c/test_shift.py

-import py
+import py, sys
 from pypy.module.pypyjit.test_pypy_c.test_00_model import BaseTestPyPyC
 
 class TestShift(BaseTestPyPyC):
         log = self.run(main, [3])
         assert log.result == 99
         loop, = log.loops_by_filename(self.filepath)
+        if sys.maxint == 2147483647:
+            SHIFT = 31
+        else:
+            SHIFT = 63
         assert loop.match_by_id('div', """
             i10 = int_floordiv(i6, i7)
             i11 = int_mul(i10, i7)
             i12 = int_sub(i6, i11)
-            i14 = int_rshift(i12, 63)
+            i14 = int_rshift(i12, %d)
             i15 = int_add(i10, i14)
-        """)
+        """ % SHIFT)
 
     def test_division_to_rshift_allcases(self):
         """

pypy/module/pypyjit/test_pypy_c/test_string.py

+import sys
 from pypy.module.pypyjit.test_pypy_c.test_00_model import BaseTestPyPyC
 
+if sys.maxint == 2147483647:
+    SHIFT = 31
+else:
+    SHIFT = 63
 
 # XXX review the <Call> descrs to replace some EF=4 with EF=3 (elidable)
 
             i14 = int_lt(i6, i9)
             guard_true(i14, descr=...)
             guard_not_invalidated(descr=...)
-            i16 = int_eq(i6, -9223372036854775808)
+            i16 = int_eq(i6, %d)
             guard_false(i16, descr=...)
             i15 = int_mod(i6, i10)
-            i17 = int_rshift(i15, 63)
+            i17 = int_rshift(i15, %d)
             i18 = int_and(i10, i17)
             i19 = int_add(i15, i18)
             i21 = int_lt(i19, 0)
             i34 = int_add(i6, 1)
             --TICK--
             jump(p0, p1, p2, p3, p4, p5, i34, p7, p8, i9, i10, p11, i12, p13, descr=...)
-        """)
+        """ % (-sys.maxint-1, SHIFT))
 
     def test_long(self):
         def main(n):
             i11 = int_lt(i6, i7)
             guard_true(i11, descr=...)
             guard_not_invalidated(descr=...)
-            i13 = int_eq(i6, -9223372036854775808)
+            i13 = int_eq(i6, %d)
             guard_false(i13, descr=...)
             i15 = int_mod(i6, i8)
-            i17 = int_rshift(i15, 63)
+            i17 = int_rshift(i15, %d)
             i18 = int_and(i8, i17)
             i19 = int_add(i15, i18)
             i21 = int_lt(i19, 0)
             guard_false(i43, descr=...)
             i46 = call(ConstClass(ll_startswith__rpy_stringPtr_rpy_stringPtr), p28, ConstPtr(ptr45), descr=<Calli 1 rr EF=0>)
             guard_false(i46, descr=...)
-            p51 = new_with_vtable(21136408)
+            p51 = new_with_vtable(...)
             setfield_gc(p51, _, descr=...)    # 7 setfields, but the order is dict-order-dependent
             setfield_gc(p51, _, descr=...)
             setfield_gc(p51, _, descr=...)
             guard_no_overflow(descr=...)
             --TICK--
             jump(p0, p1, p2, p3, p4, p5, i58, i7, descr=...)
-        """)
+        """ % (-sys.maxint-1, SHIFT))
 
     def test_str_mod(self):
         def main(n):