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

pypy/module/pypyjit/test_pypy_c/test_intbound.py::TestIntbound::()::test_assert

self = <pypy.module.pypyjit.test_pypy_c.test_intbound.TestIntbound object at 0x00000000321c9e18>

    def test_assert(self):
        def main(a):
            i, s = 0, 0
            while i < 300:
                assert a == 7
                s += a + 1
                i += 1
            return s
        log = self.run(main, [7])
        assert log.result == 300*8
        loop, = log.loops_by_filename(self.filepath)
>       assert loop.match("""
                i8 = int_lt(i6, 300)
                guard_true(i8, descr=...)
                guard_not_invalidated?
                i10 = int_add_ovf(i5, 8)
                guard_no_overflow(descr=...)
                i12 = int_add(i6, 1)
                --TICK--
                jump(..., descr=...)
            """)

pypy/module/pypyjit/test_pypy_c/test_intbound.py:254: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
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 0x0000000028d624b8>
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=<Guard0xffff87d7eba8>)
    i40 = int_lt(i34, 300)
    guard_true(i40, descr=<Guard0xffff87d8ddf0>)
    i42 = int_add_ovf(i32, 8)
    guard_no_overflow(descr=<Guard0xffff87d8de20>)
    i44 = int_add(i34, 1)
    i46 = getfield_raw_i(281473043209928, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
    i48 = int_lt(i46, 0)
    guard_false(i48, descr=<Guard0xffff87d8de80>)
    jump(p0, p1, p8, i42, i44, descr=TargetToken(281472960807520))

Expected:
    
    i8 = int_lt(i6, 300)
    guard_true(i8, descr=...)
    guard_not_invalidated?
    i10 = int_add_ovf(i5, 8)
    guard_no_overflow(descr=...)
    i12 = int_add(i6, 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-linux-aarch64 build #3041+
test: pypy/module/pypyjit/test_pypy_c/test_intbound.py::TestIntbound::()::test_assert