pypy/module/pypyjit/test_pypy_c/test_struct.py::TestStruct::()::test_pack_into_raw_buffer
self = <pypy.module.pypyjit.test_pypy_c.test_struct.TestStruct object at 0x00007f7e6d8cc368>
def test_pack_into_raw_buffer(self):
def main(n):
import array
import struct
buf = array.array('b', b'\x00'*8)
i = 1
while i < n:
struct.pack_into("h", buf, 4, i) # ID: pack_into
i += 1
return i
log = self.run(main, [1000])
assert log.result == main(1000)
loop, = log.loops_by_filename(self.filepath)
> assert loop.match_by_id('pack_into', """\
guard_not_invalidated(descr=...)
i65 = int_le(i58, 32767)
guard_true(i65, descr=...)
raw_store(i55, 4, i58, descr=<ArrayS 2>)
""")
pypy/module/pypyjit/test_pypy_c/test_struct.py:175:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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 0x00007f7e5c8ce870>
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 = 'pack_into'
('operation mismatch',)
<could not determine information>
Ignore ops: []
Got:
guard_not_invalidated(descr=<Guard0x7fbc70060b80>)
===== HERE =====
setfield_gc(p14, i45, descr=<FieldS pypy.module.array.interp_array.W_ArrayBase.inst__exports 16>)
i65 = int_le(i58, 32767)
guard_true(i65, descr=<Guard0x7fbc70033c40>)
raw_store(i55, 4, i58, descr=<ArrayS 2>)
Expected:
guard_not_invalidated(descr=...)
i65 = int_le(i58, 32767)
guard_true(i65, descr=...)
raw_store(i55, 4, i58, descr=<ArrayS 2>)
builder: pypy-c-jit-macos-x86-64 build #1404+
test: pypy/module/pypyjit/test_pypy_c/test_struct.py::TestStruct::()::test_pack_into_raw_buffer