Home - Summaries: (main) : (py3.11) : (py3.12) : Everything - Nightly builds - Benchmarks - RPython - Builders - About

pypy/module/pypyjit/test_pypy_c/test_buffers.py::TestBuffers::()::test_re_match

self = <pypy.module.pypyjit.test_pypy_c.test_buffers.TestBuffers object at 0x0000000007467130>

    def test_re_match(self):
        def main(n):
            import re
            import array
            p = re.compile(b'.+')
            a = array.array('B', b'test' * 1000)
            i = 0
            while i < n:
                i += 1
                p.match(a)  # ID: match
            return i
        log = self.run(main, [1000])
        assert log.result == 1000
        loop, = log.loops_by_filename(self.filepath)
>       assert loop.match_by_id('match', """
                guard_not_invalidated(descr=...)
                p71 = getfield_gc_r(p15, descr=...) # check that the pattern is not None and a W_BytesObject
                guard_nonnull_class(p71, ConstClass(W_BytesObject), descr=...)
                i74 = instance_ptr_eq(_, p71)
                guard_false(i74, descr=...)
                i65 = getfield_gc_i(p18, descr=...)
                i67 = int_gt(0, i65)
                guard_false(i67, descr=...)
                i69 = int_gt(#, i65)
                guard_true(i69, descr=...)
                --TICK--
            """)

pypy/module/pypyjit/test_pypy_c/test_buffers.py:19: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
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 0x0000000008fb3670>
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 = 'match'
('operation mismatch',)
<could not determine information>

Ignore ops: []
Got:
    guard_not_invalidated(descr=<Guard0x7fb37f8b1440>)
    p73 = getfield_gc_r(p14, descr=<FieldP pypy.module._sre.interp_sre.W_SRE_Pattern.inst_w_pattern 56>)
    guard_nonnull_class(p73, ConstClass(W_BytesObject), descr=<Guard0x7fb37f9771f0>)
    i76 = instance_ptr_eq(ConstPtr(ptr75), p73)
    guard_false(i76, descr=<Guard0x7fb37f8b14b0>)
    i77 = getfield_gc_i(p16, descr=<FieldS pypy.module.array.interp_array.W_ArrayBase.inst__exports 16>)

	===== HERE =====
    i79 = int_add(i77, 1)
    i80 = getfield_gc_i(p16, descr=<FieldS pypy.module.array.interp_array.W_ArrayBase.inst_len 40>)
    i82 = int_gt(0, i80)
    guard_false(i82, descr=<Guard0x7fb37f8b1520>)
    i84 = int_gt(9223372036854775807, i80)
    guard_true(i84, descr=<Guard0x7fb37f8b1590>)
    guard_not_invalidated(descr=<Guard0x7fb37f8b1670>)
    i98 = getfield_raw_i(140408977806496, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
    i100 = int_lt(i98, 0)
    guard_false(i100, descr=<Guard0x7fb37f8b16e0>)

Expected:
    
    guard_not_invalidated(descr=...)
    p71 = getfield_gc_r(p15, descr=...) # check that the pattern is not None and a W_BytesObject
    guard_nonnull_class(p71, ConstClass(W_BytesObject), descr=...)
    i74 = instance_ptr_eq(_, p71)
    guard_false(i74, descr=...)
    i65 = getfield_gc_i(p18, descr=...)
    i67 = int_gt(0, i65)
    guard_false(i67, descr=...)
    i69 = int_gt(#, i65)
    guard_true(i69, 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=...)
builder: pypy-c-jit-linux-x86-64 build #11948+
test: pypy/module/pypyjit/test_pypy_c/test_buffers.py::TestBuffers::()::test_re_match