pypy/module/pypyjit/test_pypy_c/test_instance.py::TestInstance::()::test_python_contains
self = <pypy.module.pypyjit.test_pypy_c.test_instance.TestInstance object at 0x113d5cf0>
def test_python_contains(self):
def main():
class A(object):
def __contains__(self, v):
return True
i = 0
a = A()
while i < 100:
i += i in a # ID: contains
b = 0 # to make sure that JUMP_ABSOLUTE is not part of the ID
log = self.run(main, [], threshold=80)
loop, = log.loops_by_filename(self.filepath)
> assert loop.match_by_id("contains", """
guard_not_invalidated(descr=...)
i11 = force_token()
i12 = int_add(i5, 1)
""")
pypy/module/pypyjit/test_pypy_c/test_instance.py:208:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pypy/module/pypyjit/test_pypy_c/model.py:182: in match_by_id
return matcher.match(expected_src, ignore_ops=ignore_ops)
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 0x11ed7eb0>
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 = 'contains'
('operation mismatch',)
<could not determine information>
Ignore ops: []
Got:
===== HERE =====
p52 = force_token()
i57 = int_add(i45, 1)
Expected:
guard_not_invalidated(descr=...)
i11 = force_token()
i12 = int_add(i5, 1)
builder: pypy-c-jit-linux-x86-32 build #8482+
test: pypy/module/pypyjit/test_pypy_c/test_instance.py::TestInstance::()::test_python_contains