pypy/module/pypyjit/test_pypy_c/test_00_model.py::TestRunPyPyC::()::test_loop_match
self = <pypy.module.pypyjit.test_pypy_c.test_00_model.TestRunPyPyC object at 0x0000000007967788>
def test_loop_match(self):
def f():
i = 0
while i < 1003:
i += 1 # ID: increment
return i
#
log = self.run(f)
loop, = log.loops_by_id('increment')
> assert loop.match("""
i6 = int_lt(i4, 1003)
guard_true(i6, descr=...)
i8 = int_add(i4, 1)
# signal checking stuff
guard_not_invalidated(descr=...)
i10 = getfield_raw_i(..., descr=<.* pypysig_long_struct_inner.c_value .*>)
i14 = int_lt(i10, 0)
guard_false(i14, descr=...)
jump(..., descr=...)
""")
pypy/module/pypyjit/test_pypy_c/test_00_model.py:565:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pypy/module/pypyjit/test_pypy_c/model.py:177: in match
return matcher.match(expected_src, **kwds)
pypy/module/pypyjit/test_pypy_c/model.py:524: in match
self.match_loop(expected_ops, ignore_ops)
pypy/module/pypyjit/test_pypy_c/model.py:500: in match_loop
self.match_op(op, exp_op)
pypy/module/pypyjit/test_pypy_c/model.py:409: in match_op
self._assert(op.name == exp_opname, "operation mismatch")
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.pypyjit.test_pypy_c.model.OpMatcher object at 0x0000000008ed4c60>
cond = False, message = 'operation mismatch'
def _assert(self, cond, message):
if not cond:
> raise InvalidMatch(message, frame=sys._getframe(1))
E InvalidMatch: operation mismatch
pypy/module/pypyjit/test_pypy_c/model.py:402: InvalidMatch
---------- Captured stdout call ----------
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Loops don't match
=================
loop id = None
('operation mismatch',)
<could not determine information>
Ignore ops: []
Got:
===== HERE =====
guard_not_invalidated(descr=<Guard0x7f8722be37e0>)
i26 = int_lt(i20, 1003)
guard_true(i26, descr=<Guard0x7f8722b10218>)
i28 = int_add(i20, 1)
i30 = getfield_raw_i(140218378554016, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i32 = int_lt(i30, 0)
guard_false(i32, descr=<Guard0x7f8722b10288>)
jump(p0, p1, i28, descr=TargetToken(140218379345952))
Expected:
i6 = int_lt(i4, 1003)
guard_true(i6, descr=...)
i8 = int_add(i4, 1)
# signal checking stuff
guard_not_invalidated(descr=...)
i10 = getfield_raw_i(..., descr=<.* pypysig_long_struct_inner.c_value .*>)
i14 = int_lt(i10, 0)
guard_false(i14, descr=...)
jump(..., descr=...)
builder: pypy-c-jit-linux-x86-64 build #11971+
test: pypy/module/pypyjit/test_pypy_c/test_00_model.py::TestRunPyPyC::()::test_loop_match