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

pypy/module/pypyjit/test_pypy_c/test_misc.py::TestMisc::()::test_locals

self = <pypy.module.pypyjit.test_pypy_c.test_misc.TestMisc object at 0x000000012202c838>

    @pytest.mark.skipif("sys.maxint == 2 ** 31 - 1")
    def test_locals(self):
        def main(n):
            res = 0
            for i in range(n):
                locals()["abc"] = 1
                res += locals()["abc"] + locals()["i"]
            return res
        log = self.run(main, [3000])
        loop, = log.loops_by_filename(self.filepath)
>       assert loop.match("""
                ...
                i82 = int_add(i76, 1)
                setfield_gc(p16, i82, descr=...)
                guard_not_invalidated(descr=...)
                setarrayitem_gc(p63, 1, i71, descr=...)
                setarrayitem_gc(p63, 2, i76, descr=...)
                setarrayitem_gc(p63, 0, i77, descr=...)
                i87 = int_add_ovf(i71, i82)
                guard_no_overflow(descr=...)
    
                --TICK--
    
                i92 = arraylen_gc(p61, descr=...)
                i93 = arraylen_gc(p63, descr=...)
                jump(..., descr=...)
            """)

pypy/module/pypyjit/test_pypy_c/test_misc.py:513: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
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:522: in match
    self.match_loop(expected_ops, ignore_ops)
pypy/module/pypyjit/test_pypy_c/model.py:498: in match_loop
    self.match_op(op, exp_op)
pypy/module/pypyjit/test_pypy_c/model.py:407: in match_op
    self._assert(op.name == exp_opname, "operation mismatch")
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <pypy.module.pypyjit.test_pypy_c.model.OpMatcher object at 0x00000001108c0d40>
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:400: InvalidMatch
---------- Captured stdout call ----------
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Loops don't match
=================
loop id = None
('operation mismatch',)
<could not determine information>

Ignore ops: []
Got:
    guard_not_invalidated(descr=<Guard0x1306e9898>)
    i70 = int_lt(i68, i28)
    guard_true(i70, descr=<Guard0x13076cc80>)
    i72 = int_add(i68, 1)
    setfield_gc(p14, i72, descr=<FieldS pypy.module.__builtin__.functional.W_IntRangeIterator.inst_current 8>)

	===== HERE =====
    setarrayitem_gc(p55, 1, i63, descr=<ArrayS 8>)
    setarrayitem_gc(p55, 2, i68, descr=<ArrayS 8>)
    setarrayitem_gc(p55, 0, i69, descr=<ArrayS 8>)
    i76 = int_add_ovf(i63, i72)
    guard_no_overflow(descr=<Guard0x1306e98e0>)
    i79 = getfield_raw_i(4387071152, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
    i81 = int_lt(i79, 0)
    guard_false(i81, descr=<Guard0x13076cd70>)
    i82 = arraylen_gc(p53, descr=<ArrayP 8>)
    i83 = arraylen_gc(p55, descr=<ArrayS 8>)
    jump(p0, p1, p5, p8, i76, i68, p14, i72, i28, p40, p43, p48, p53, p55, i69, descr=TargetToken(5108008992))

Expected:
    
    ...
    i82 = int_add(i76, 1)
    setfield_gc(p16, i82, descr=...)
    guard_not_invalidated(descr=...)
    setarrayitem_gc(p63, 1, i71, descr=...)
    setarrayitem_gc(p63, 2, i76, descr=...)
    setarrayitem_gc(p63, 0, i77, descr=...)
    i87 = int_add_ovf(i71, i82)
    guard_no_overflow(descr=...)
    
    
    ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
    ticker_cond0 = int_lt(ticker0, 0)
    guard_false(ticker_cond0, descr=...)
    
    
    i92 = arraylen_gc(p61, descr=...)
    i93 = arraylen_gc(p63, descr=...)
    jump(..., descr=...)
builder: pypy-c-jit-macos-arm64 build #1420+
test: pypy/module/pypyjit/test_pypy_c/test_misc.py::TestMisc::()::test_locals