pypy/module/pypyjit/test_pypy_c/test_thread.py::TestThread::()::test_tls
self = <pypy.module.pypyjit.test_pypy_c.test_thread.TestThread object at 0x00007fd290413a60>
def test_tls(self):
def main(n):
try:
from _thread import _local
except ImportError:
from thread import _local
local = _local()
local.x = "abc" # prevent type unboxing
local.x = 1
i = 0
while i < n:
i += local.x
return 0
log = self.run(main, [500])
assert round(log.result, 6) == round(main(500), 6)
loop, = log.loops_by_filename(self.filepath)
> assert loop.match("""
i53 = int_lt(i48, i27)
guard_true(i53, descr=...)
i54 = int_add_ovf(i48, i47)
guard_no_overflow(descr=...)
--TICK--
i58 = arraylen_gc(p43, descr=...)
jump(..., descr=...)
""")
pypy/module/pypyjit/test_pypy_c/test_thread.py:49:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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 0x00007fd2b4cf7018>
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=<Guard0x7f9c301d3470>)
i54 = int_lt(i49, i28)
guard_true(i54, descr=<Guard0x7f9c301e76a8>)
i55 = int_add_ovf(i49, i48)
guard_no_overflow(descr=<Guard0x7f9c301e76e0>)
i57 = getfield_raw_i(4598070688, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i59 = int_lt(i57, 0)
guard_false(i59, descr=<Guard0x7f9c301e7750>)
i60 = arraylen_gc(p44, descr=<ArrayP 8>)
jump(p0, p1, p8, p10, p12, i55, p20, p22, i28, p36, p40, p44, p46, i48, descr=TargetToken(140308798904736))
Expected:
i53 = int_lt(i48, i27)
guard_true(i53, descr=...)
i54 = int_add_ovf(i48, i47)
guard_no_overflow(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=...)
i58 = arraylen_gc(p43, descr=...)
jump(..., descr=...)
builder: pypy-c-jit-macos-x86-64 build #1427+
test: pypy/module/pypyjit/test_pypy_c/test_thread.py::TestThread::()::test_tls