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

pypy/module/pypyjit/test_pypy_c/test_intbound.py::TestIntbound::()::test_intbound_mul

self = <pypy.module.pypyjit.test_pypy_c.test_intbound.TestIntbound object at 0x000000000d31ab48>

    def test_intbound_mul(self):
        def main(a):
            i, s = 0, 0
            while i < 300:
                assert i >= 0
                if 2 * i < 30000:
                    s += 1
                else:
                    s += a
                i += 1
            return s
        #
        log = self.run(main, [7])
        assert log.result == 300
        loop, = log.loops_by_filename(self.filepath)
>       assert loop.match("""
                i8 = int_lt(i6, 300)
                guard_true(i8, descr=...)
                guard_not_invalidated?
                i10 = int_lshift(i6, 1)
                i12 = int_add_ovf(i5, 1)
                guard_no_overflow(descr=...)
                i14 = int_add(i6, 1)
                --TICK--
                jump(..., descr=...)
            """)

pypy/module/pypyjit/test_pypy_c/test_intbound.py:231: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
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 0x0000000009f1ca30>
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=<Guard0x7f1f125e3920>)
    i38 = int_lt(i32, 300)
    guard_true(i38, descr=<Guard0x7f1f12510640>)
    i40 = int_lshift(i32, 1)
    i42 = int_add_ovf(i30, 1)
    guard_no_overflow(descr=<Guard0x7f1f12510678>)
    i44 = int_add(i32, 1)
    i46 = getfield_raw_i(139771427228320, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
    i48 = int_lt(i46, 0)
    guard_false(i48, descr=<Guard0x7f1f125106e8>)
    jump(p0, p1, p8, i42, i44, descr=TargetToken(139771428020576))

Expected:
    
    i8 = int_lt(i6, 300)
    guard_true(i8, descr=...)
    guard_not_invalidated?
    i10 = int_lshift(i6, 1)
    i12 = int_add_ovf(i5, 1)
    guard_no_overflow(descr=...)
    i14 = int_add(i6, 1)
    
    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_intbound.py::TestIntbound::()::test_intbound_mul