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

pypy/module/pypyjit/test_pypy_c/test_getframe.py::TestGetFrame::()::test_getframe_one

self = <pypy.module.pypyjit.test_pypy_c.test_getframe.TestGetFrame object at 0x00007fd2b6b14608>

    def test_getframe_one(self):
        def main(n):
            import sys
    
            i = 0
            while i < n:
                assert sys._getframe(0).f_code.co_filename == __file__
                i += 1
            return i
    
        log = self.run(main, [300])
        assert log.result == 300
        loop, = log.loops_by_filename(self.filepath)
>       assert loop.match("""
            i54 = int_lt(i47, i28)
            guard_true(i54, descr=...)
            guard_not_invalidated(descr=...)
            i55 = int_add(i47, 1)
            --TICK--
            jump(..., descr=...)
            """)

pypy/module/pypyjit/test_pypy_c/test_getframe.py:18: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
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 0x00007fd27208e8e0>
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=<Guard0x7fc3c87272e0>)
    i47 = int_lt(i42, i24)
    guard_true(i47, descr=<Guard0x7fc3c873b788>)
    i49 = int_add(i42, 1)
    i51 = getfield_raw_i(4597886368, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
    i53 = int_lt(i51, 0)
    guard_false(i53, descr=<Guard0x7fc3c873b7f8>)
    jump(p0, p1, p8, p10, i49, i24, p34, descr=TargetToken(140478858343136))

Expected:
    
    i54 = int_lt(i47, i28)
    guard_true(i54, descr=...)
    guard_not_invalidated(descr=...)
    i55 = int_add(i47, 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_getframe.py::TestGetFrame::()::test_getframe_one