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

pypy/module/pypyjit/test_pypy_c/test_instance.py::TestInstance::()::test_namedtuple_construction

self = <pypy.module.pypyjit.test_pypy_c.test_instance.TestInstance object at 0x00007f953e94df30>

    def test_namedtuple_construction(self):
        def main():
            from collections import namedtuple
            A = namedtuple("A", "x y")
            res = 0
            i = 0
            while i < 2000:
                res += A(i, 0).x
                i += 1
        log = self.run(main, [])
        loop, = log.loops_by_filename(self.filepath)
>       assert loop.match("""
                i7 = int_lt(i5, 2000)
                guard_true(i7, descr=...)
                guard_not_invalidated(descr=...)
                p1 = force_token()
                p2 = force_token()
                i20 = int_add_ovf(i19, i5)
                guard_no_overflow(descr=...)
                i9 = int_add(i5, 1)
                --TICK--
                jump(..., descr=...)
            """)

pypy/module/pypyjit/test_pypy_c/test_instance.py:390: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
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 0x00007f953e9370f8>
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:
    i77 = int_lt(i71, 2000)
    guard_true(i77, descr=<Guard0x7fd9d029c480>)
    guard_not_invalidated(descr=<Guard0x7fd9d029fd70>)
    p78 = force_token()

	===== HERE =====
    p81 = new_with_vtable(descr=<SizeDescr 32>)
    setfield_gc(p81, ConstPtr(ptr82), descr=<FieldP pypy.objspace.std.unicodeobject.W_UnicodeObject.inst__utf8 24 pure>)
    i86 = call_i(ConstClass(ll_call_lookup_function_trampoline__v2234___simple_call__function_), p46, p81, 4086412627765446930, 0, descr=<Calli 8 rrii EF=5 OS=4>)
    setfield_gc(p81, ConstPtr(null), descr=<FieldP pypy.objspace.std.unicodeobject.W_UnicodeObject.inst__index_storage 8>)
    setfield_gc(p81, 10, descr=<FieldS pypy.objspace.std.unicodeobject.W_UnicodeObject.inst__length 16 pure>)
    guard_no_exception(descr=<Guard0x7fd9d029c4d0>)
    i90 = int_lt(i86, 0)
    guard_false(i90, descr=<Guard0x7fd9d029fde0>)
    p91 = getinteriorfield_gc_r(p57, i86, descr=<InteriorFieldDescr <FieldP odictentry.value 8>>)
    guard_value(p91, ConstPtr(ptr92), descr=<Guard0x7fd9d029c520>)
    p94 = force_token()
    i98 = int_add_ovf(i69, i71)
    guard_no_overflow(descr=<Guard0x7fd9d029fe18>)
    i100 = int_add(i71, 1)
    i102 = getfield_raw_i(4601653840, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
    i104 = int_lt(i102, 0)
    guard_false(i104, descr=<Guard0x7fd9d029fe88>)
    jump(p0, p1, p8, i98, i100, p33, p46, p34, p57, descr=TargetToken(140573477134432))

Expected:
    
    i7 = int_lt(i5, 2000)
    guard_true(i7, descr=...)
    guard_not_invalidated(descr=...)
    p1 = force_token()
    p2 = force_token()
    i20 = int_add_ovf(i19, i5)
    guard_no_overflow(descr=...)
    i9 = int_add(i5, 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-macos-x86-64 build #1329+
test: pypy/module/pypyjit/test_pypy_c/test_instance.py::TestInstance::()::test_namedtuple_construction