pypy/module/pypyjit/test_pypy_c/test_exception.py::TestException::()::test_reraise
self = <pypy.module.pypyjit.test_pypy_c.test_exception.TestException object at 0x00007fd2b5352b10>
def test_reraise(self):
def f(n):
i = 0
while i < n:
try:
try:
raise KeyError
except KeyError:
raise
except KeyError:
i += 1
return i
log = self.run(f, [100000])
assert log.result == 100000
loop, = log.loops_by_filename(self.filepath)
> assert loop.match("""
i7 = int_lt(i4, i5)
guard_true(i7, descr=...)
guard_not_invalidated(descr=...)
--EXC-TICK--
i14 = int_add(i4, 1)
--TICK--
jump(..., descr=...)
""")
pypy/module/pypyjit/test_pypy_c/test_exception.py:85:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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 0x00007fd2b569d4e8>
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=<Guard0x7fdc180e33d0>)
i44 = int_lt(i39, i24)
guard_true(i44, descr=<Guard0x7fdc181039b8>)
i46 = getfield_raw_i(4596874656, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i48 = int_lt(i46, 0)
guard_false(i48, descr=<Guard0x7fdc18103a28>)
i50 = int_add(i39, 1)
i52 = getfield_raw_i(4596874656, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i54 = int_lt(i52, 0)
guard_false(i54, descr=<Guard0x7fdc18103a98>)
jump(p0, p1, p8, i50, i24, p36, descr=TargetToken(140583273221344))
Expected:
i7 = int_lt(i4, i5)
guard_true(i7, descr=...)
guard_not_invalidated(descr=...)
ticker2 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
ticker_cond1 = int_lt(ticker2, 0)
guard_false(ticker_cond1, descr=...)
i14 = int_add(i4, 1)
guard_not_invalidated?
ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
ticker_cond0 = int_lt(ticker0, 0)
guard_false(ticker_cond0, descr=...)
jump(..., descr=...)
builder: pypy-c-jit-macos-x86-64 build #1427+
test: pypy/module/pypyjit/test_pypy_c/test_exception.py::TestException::()::test_reraise