pypy/module/pypyjit/test_pypy_c/test_call.py::TestCall::()::test_kwargs_virtual2
self = <pypy.module.pypyjit.test_pypy_c.test_call.TestCall object at 0x000001bd244b36a8>
def test_kwargs_virtual2(self):
log = self.run("""
def f(*args, **kwargs):
kwargs['a'] = kwargs['z'] * 0
return g(1, *args, **kwargs)
def g(x, y, z=2, a=1):
return x - y + z + a
def main(stop):
res = 0
i = 0
while i < stop:
res = f(res, z=i) # ID: call
i += 1
return res""", [1000])
assert log.result == 500
loop, = log.loops_by_id('call')
> assert loop.match("""
i65 = int_lt(i58, i29)
guard_true(i65, descr=...)
guard_not_invalidated(..., descr=...)
i66 = force_token()
i67 = force_token()
i69 = int_sub_ovf(1, i56)
guard_no_overflow(..., descr=...)
i70 = int_add_ovf(i69, i58)
guard_no_overflow(..., descr=...)
i71 = int_add(i58, 1)
--TICK--
jump(..., descr=...)
""")
pypy\module\pypyjit\test_pypy_c\test_call.py:523:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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 0x000001bd2450cc60>
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=<Guard0x1e5333c8338>)
i55 = int_lt(i50, i26)
guard_true(i55, descr=<Guard0x1e5333d1b50>)
p56 = force_token()
p59 = force_token()
i63 = int_sub_ovf(1, i46)
guard_no_overflow(descr=<Guard0x1e5333d1b80>)
i64 = int_add_ovf(i63, i50)
guard_no_overflow(descr=<Guard0x1e5333d1bb0>)
i68 = int_add(i50, 1)
i70 = getfield_raw_i(140729701711872, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i72 = int_lt(i70, 0)
guard_false(i72, descr=<Guard0x1e5333d1c10>)
jump(p0, p1, p8, i64, i68, i26, p31, descr=TargetToken(2083918770976))
Expected:
i65 = int_lt(i58, i29)
guard_true(i65, descr=...)
guard_not_invalidated(..., descr=...)
i66 = force_token()
i67 = force_token()
i69 = int_sub_ovf(1, i56)
guard_no_overflow(..., descr=...)
i70 = int_add_ovf(i69, i58)
guard_no_overflow(..., descr=...)
i71 = int_add(i58, 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-win-x86-64 build #2538+
test: pypy/module/pypyjit/test_pypy_c/test_call.py::TestCall::()::test_kwargs_virtual2