pypy/module/pypyjit/test_pypy_c/test_buffers.py::TestBuffers::()::test_struct_unpack
self = <pypy.module.pypyjit.test_pypy_c.test_buffers.TestBuffers object at 0x000000000dfd6918>
def test_struct_unpack(self):
def main(n):
import _struct as struct
import array
a = array.array('B', struct.pack('i', 42))
i = 0
while i < n:
i += 1
struct.unpack('i', a) # ID: unpack
return i
log = self.run(main, [1000])
assert log.result == 1000
loop, = log.loops_by_filename(self.filepath)
> assert loop.match_by_id('unpack', """
guard_not_invalidated(descr=...)
i66 = raw_load_i(i53, 0, descr=<ArrayS 4>)
--TICK--
""")
pypy/module/pypyjit/test_pypy_c/test_buffers.py:46:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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 0x000000000e198e20>
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 = 'unpack'
('operation mismatch',)
<could not determine information>
Ignore ops: []
Got:
===== HERE =====
i66 = raw_load_i(i53, 0, descr=<ArrayS 4>)
i68 = getfield_raw_i(140455329467040, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i70 = int_lt(i68, 0)
guard_false(i70, descr=<Guard0x7fbe4a594bb8>)
Expected:
guard_not_invalidated(descr=...)
i66 = raw_load_i(i53, 0, descr=<ArrayS 4>)
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=...)
builder: pypy-c-jit-linux-x86-64 build #11971+
test: pypy/module/pypyjit/test_pypy_c/test_buffers.py::TestBuffers::()::test_struct_unpack