Home - Summaries: (main) : (py3.11) : (py3.12) : Everything - Nightly builds - Benchmarks - RPython - Builders - About

pypy/module/pypyjit/test_pypy_c/test_exception.py::TestException::()::test_exception_inside_loop_1

self = <pypy.module.pypyjit.test_pypy_c.test_exception.TestException object at 0x0000000010b152b8>

    def test_exception_inside_loop_1(self):
        def main(n):
            while n:
                try:
                    raise ValueError
                except ValueError:
                    pass
                n -= 1
            return n
        #
        log = self.run(main, [1000])
        assert log.result == 0
        loop, = log.loops_by_filename(self.filepath)
>       assert loop.match("""
            i5 = int_is_true(i3)
            guard_true(i5, descr=...)
            guard_not_invalidated(descr=...)
            --EXC-TICK--
            i12 = int_sub_ovf(i3, 1)
            guard_no_overflow(descr=...)
            --TICK--
            jump(..., descr=...)
            """)

pypy/module/pypyjit/test_pypy_c/test_exception.py:37: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
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 0x0000000010b8c8a8>
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=<Guard0x7f7abdbe3ab0>)
    i40 = int_is_true(i35)
    guard_true(i40, descr=<Guard0x7f7abdb12c98>)
    i42 = getfield_raw_i(140165207362208, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
    i44 = int_lt(i42, 0)
    guard_false(i44, descr=<Guard0x7f7abdb12d08>)
    i46 = int_sub_ovf(i35, 1)
    guard_no_overflow(descr=<Guard0x7f7abdb12d40>)
    i48 = getfield_raw_i(140165207362208, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
    i50 = int_lt(i48, 0)
    guard_false(i50, descr=<Guard0x7f7abdb12db0>)
    jump(p0, p1, i46, p16, p32, descr=TargetToken(140165145256800))

Expected:
    
    i5 = int_is_true(i3)
    guard_true(i5, 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=...)
    
    i12 = int_sub_ovf(i3, 1)
    guard_no_overflow(descr=...)
    
        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-linux-x86-64 build #11971+
test: pypy/module/pypyjit/test_pypy_c/test_exception.py::TestException::()::test_exception_inside_loop_1