Author: Armin Rigo <ar...@tunes.org> Branch: Changeset: r56460:8e1b02e2eac0 Date: 2012-07-26 10:49 +0200 http://bitbucket.org/pypy/pypy/changeset/8e1b02e2eac0/
Log: Fix the places that used to write a number and expect a possibly different one. diff --git a/pypy/module/pypyjit/test_pypy_c/test_00_model.py b/pypy/module/pypyjit/test_pypy_c/test_00_model.py --- a/pypy/module/pypyjit/test_pypy_c/test_00_model.py +++ b/pypy/module/pypyjit/test_pypy_c/test_00_model.py @@ -450,7 +450,7 @@ 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=...) diff --git a/pypy/module/pypyjit/test_pypy_c/test_call.py b/pypy/module/pypyjit/test_pypy_c/test_call.py --- a/pypy/module/pypyjit/test_pypy_c/test_call.py +++ b/pypy/module/pypyjit/test_pypy_c/test_call.py @@ -370,7 +370,7 @@ # 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 .*>) @@ -378,7 +378,7 @@ 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>) ... """) diff --git a/pypy/module/pypyjit/test_pypy_c/test_misc.py b/pypy/module/pypyjit/test_pypy_c/test_misc.py --- a/pypy/module/pypyjit/test_pypy_c/test_misc.py +++ b/pypy/module/pypyjit/test_pypy_c/test_misc.py @@ -241,7 +241,7 @@ 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=...) diff --git a/pypy/module/pypyjit/test_pypy_c/test_shift.py b/pypy/module/pypyjit/test_pypy_c/test_shift.py --- a/pypy/module/pypyjit/test_pypy_c/test_shift.py +++ b/pypy/module/pypyjit/test_pypy_c/test_shift.py @@ -1,4 +1,4 @@ -import py +import py, sys from pypy.module.pypyjit.test_pypy_c.test_00_model import BaseTestPyPyC class TestShift(BaseTestPyPyC): @@ -56,13 +56,17 @@ 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): """ diff --git a/pypy/module/pypyjit/test_pypy_c/test_string.py b/pypy/module/pypyjit/test_pypy_c/test_string.py --- a/pypy/module/pypyjit/test_pypy_c/test_string.py +++ b/pypy/module/pypyjit/test_pypy_c/test_string.py @@ -1,5 +1,10 @@ +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) @@ -22,10 +27,10 @@ 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) @@ -45,7 +50,7 @@ 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): @@ -62,10 +67,10 @@ 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) @@ -95,7 +100,7 @@ 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=...) @@ -111,7 +116,7 @@ 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): _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit