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

pypy/module/pypyjit/test_pypy_c/test_call.py::TestCall::()::test_static_classmethod_call

self = <pypy.module.pypyjit.test_pypy_c.test_call.TestCall object at 0x0000000007ef7fa0>

    def test_static_classmethod_call(self):
        def fn(n):
            class A(object):
                @classmethod
                def f(cls, i):
                    return i + (cls is A) + 1
                @staticmethod
                def g(i):
                    return i - 1
            #
            i = 0
            a = A()
            while i < n:
                x = a.f(i)
                i = a.g(x)
            return i
        #
        log = self.run(fn, [1000])
        assert log.result == 1000
        loop, = log.loops_by_filename(self.filepath)
>       assert loop.match("""
                i14 = int_lt(i6, i9)
                guard_true(i14, descr=...)
                guard_not_invalidated(descr=...)
                i15 = force_token()
                i17 = int_add_ovf(i8, 1)
                guard_no_overflow(descr=...)
                i18 = force_token()
                --TICK--
                jump(..., descr=...)
            """)

pypy/module/pypyjit/test_pypy_c/test_call.py:177: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
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 0x000000000820d0c0>
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=<Guard0x7f18e50d19c0>)
    i60 = int_lt(i47, i30)
    guard_true(i60, descr=<Guard0x7f18e1393a98>)
    p61 = force_token()
    i65 = int_add_ovf(i59, 1)
    guard_no_overflow(descr=<Guard0x7f18e1393ad0>)
    p67 = force_token()
    i72 = getfield_raw_i(139744896158368, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
    i74 = int_lt(i72, 0)
    guard_false(i74, descr=<Guard0x7f18e13a2020>)
    jump(p0, p1, p8, i59, p12, i65, p16, p24, i30, p37, i65, descr=TargetToken(139744834578080))

Expected:
    
    i14 = int_lt(i6, i9)
    guard_true(i14, descr=...)
    guard_not_invalidated(descr=...)
    i15 = force_token()
    i17 = int_add_ovf(i8, 1)
    guard_no_overflow(descr=...)
    i18 = force_token()
    
    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_call.py::TestCall::()::test_static_classmethod_call