pypy/module/pypyjit/test_pypy_c/test_call.py::TestCall::()::test_local_closure_is_virtual
self = <pypy.module.pypyjit.test_pypy_c.test_call.TestCall object at 0x00007fd27296d0c0>
def test_local_closure_is_virtual(self):
log = self.run("""
def main():
i = 0
while i < 5000:
def add():
return i + 1
i = add() # ID: call
""", [])
loop, = log.loops_by_id('call')
> assert loop.match("""
i8 = getfield_gc_i(p6, descr=<FieldS pypy.objspace.std.intobject.W_IntObject.inst_intval .*>)
i10 = int_lt(i8, 5000)
guard_true(i10, descr=...)
guard_not_invalidated?
i11 = force_token()
i13 = int_add(i8, 1)
--TICK--
p22 = new_with_vtable(descr=<SizeDescr .*>)
setfield_gc(p22, i13, descr=<FieldS pypy.objspace.std.intobject.W_IntObject.inst_intval .*>)
setfield_gc(p4, p22, descr=<FieldP pypy.interpreter.nestedscope.Cell.inst_w_value .*>)
jump(..., descr=...)
""")
pypy/module/pypyjit/test_pypy_c/test_call.py:468:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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 0x00007fd2729ed9b8>
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=<Guard0x7f84701d4f70>)
i44 = getfield_gc_i(p43, descr=<FieldS pypy.objspace.std.intobject.W_IntObject.inst_intval 8 pure>)
i46 = int_lt(i44, 5000)
guard_true(i46, descr=<Guard0x7f84701f19b8>)
p47 = force_token()
i51 = int_add(i44, 1)
i54 = getfield_raw_i(4536065440, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i56 = int_lt(i54, 0)
guard_false(i56, descr=<Guard0x7f84701f1a28>)
p57 = new_with_vtable(descr=<SizeDescr 16>)
setfield_gc(p57, i51, descr=<FieldS pypy.objspace.std.intobject.W_IntObject.inst_intval 8 pure>)
setfield_gc(p10, p57, descr=<FieldP pypy.interpreter.nestedscope.Cell.inst_w_value 16>)
jump(p0, p1, p10, p57, p25, p37, descr=TargetToken(140206793461408))
Expected:
i8 = getfield_gc_i(p6, descr=<FieldS pypy.objspace.std.intobject.W_IntObject.inst_intval .*>)
i10 = int_lt(i8, 5000)
guard_true(i10, descr=...)
guard_not_invalidated?
i11 = force_token()
i13 = int_add(i8, 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=...)
p22 = new_with_vtable(descr=<SizeDescr .*>)
setfield_gc(p22, i13, descr=<FieldS pypy.objspace.std.intobject.W_IntObject.inst_intval .*>)
setfield_gc(p4, p22, descr=<FieldP pypy.interpreter.nestedscope.Cell.inst_w_value .*>)
jump(..., descr=...)
builder: pypy-c-jit-macos-x86-64 build #1427+
test: pypy/module/pypyjit/test_pypy_c/test_call.py::TestCall::()::test_local_closure_is_virtual