pypy/module/pypyjit/test_pypy_c/test_string.py::TestString::()::test_lookup_codec
self = <pypy.module.pypyjit.test_pypy_c.test_string.TestString object at 0x000000000e7bff30>
def test_lookup_codec(self):
log = self.run("""
import codecs
def main(n):
for i in range(n):
codecs.lookup('utf8')
return i
""", [1000])
loop, = log.loops_by_filename(self.filepath)
> assert loop.match("""
i45 = int_lt(i43, i26)
guard_true(i45, descr=...)
i46 = int_add(i43, 1)
setfield_gc(p15, i46, descr=<FieldS pypy.module.__builtin__.functional.W_IntRangeIterator.inst_current 8>)
guard_not_invalidated(descr=...)
--TICK--
jump(..., descr=...)
""")
pypy/module/pypyjit/test_pypy_c/test_string.py:256:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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 0x000000000994ee90>
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=<Guard0x7fb0341e37e0>)
i32 = int_lt(i31, i23)
guard_true(i32, descr=<Guard0x7fb034112218>)
i34 = int_add(i31, 1)
i36 = getfield_raw_i(140394763717280, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
setfield_gc(p12, i34, descr=<FieldS pypy.module.__builtin__.functional.W_IntRangeIterator.inst_current 8>)
i38 = int_lt(i36, 0)
guard_false(i38, descr=<Guard0x7fb0341e3830>)
jump(p0, p1, p8, i31, p12, i34, i23, descr=TargetToken(140394764501152))
Expected:
i45 = int_lt(i43, i26)
guard_true(i45, descr=...)
i46 = int_add(i43, 1)
setfield_gc(p15, i46, descr=<FieldS pypy.module.__builtin__.functional.W_IntRangeIterator.inst_current 8>)
guard_not_invalidated(descr=...)
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-linux-x86-64 build #11971+
test: pypy/module/pypyjit/test_pypy_c/test_string.py::TestString::()::test_lookup_codec