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

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 0x000001bd1dc5afa8>

    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 0x000001bd1dd0e598>
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=<Guard0x1d3d4f46068>)
    i26 = int_lt(i20, 1003)
    guard_true(i26, descr=<Guard0x1d3d4f3f640>)
    i28 = int_add(i20, 1)
    i30 = getfield_raw_i(140729701711872, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
    i32 = int_lt(i30, 0)
    guard_false(i32, descr=<Guard0x1d3d4f3f6a0>)
    jump(p0, p1, i28, descr=TargetToken(2009322321504))

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-win-x86-64 build #2538+
test: pypy/module/pypyjit/test_pypy_c/test_00_model.py::TestRunPyPyC::()::test_loop_match