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

pypy/module/pypyjit/test_pypy_c/test_min_max.py::TestMinMax::()::test_min_max

self = <pypy.module.pypyjit.test_pypy_c.test_min_max.TestMinMax object at 0x000001bd21c14020>

    def test_min_max(self):
        def main():
            i=0
            sa=0
            while i < 300:
                sa+=min(max(i, 3000), 4000)
                i+=1
            return sa
        log = self.run(main, [])
        assert log.result == 300*3000
        loop, = log.loops_by_filename(self.filepath)
>       assert loop.match("""
                i7 = int_lt(i4, 300)
                guard_true(i7, descr=...)
                guard_not_invalidated(descr=...)
                i9 = int_add_ovf(i5, 3000)
                guard_no_overflow(descr=...)
                i11 = int_add(i4, 1)
                --TICK--
                jump(..., descr=...)
            """)

pypy\module\pypyjit\test_pypy_c\test_min_max.py:16: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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 0x000001bd21c27638>
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=<Guard0x19f0472c020>)
    i38 = int_lt(i32, 300)
    guard_true(i38, descr=<Guard0x19f0471fb50>)
    i40 = int_add_ovf(i30, 3000)
    guard_no_overflow(descr=<Guard0x19f0471fb80>)
    i42 = int_add(i32, 1)
    i44 = getfield_raw_i(140729701711872, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
    i46 = int_lt(i44, 0)
    guard_false(i46, descr=<Guard0x19f0471fbe0>)
    jump(p0, p1, i42, i40, descr=TargetToken(1782485841504))

Expected:
    
    i7 = int_lt(i4, 300)
    guard_true(i7, descr=...)
    guard_not_invalidated(descr=...)
    i9 = int_add_ovf(i5, 3000)
    guard_no_overflow(descr=...)
    i11 = int_add(i4, 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-win-x86-64 build #2538+
test: pypy/module/pypyjit/test_pypy_c/test_min_max.py::TestMinMax::()::test_min_max