Commits

Armin Rigo committed b03753b

Fix test.

A nice side-effect of the improve-consecutive-dict-lookups branch: multiple loads or stores of
attributes in an oldstyle class instance are folded.

Comments (0)

Files changed (1)

pypy/module/pypyjit/test_pypy_c/test_instance.py

             i = 0
             b = B(1)
             while i < 100:
-                b.x
-                v = b.x # ID: loadattr
+                v = b.x # ID: loadattr1
+                v = b.x # ID: loadattr2
                 i += v
             return i
 
         log = self.run(main, [], threshold=80)
         loop, = log.loops_by_filename(self.filepath)
-        assert loop.match_by_id('loadattr',
+        assert loop.match_by_id('loadattr1',
         '''
+        guard_not_invalidated(descr=...)
         i19 = call(ConstClass(ll_dict_lookup), _, _, _, descr=...)
         guard_no_exception(descr=...)
         i21 = int_and(i19, _)
         i29 = int_is_true(i28)
         guard_true(i29, descr=...)
         ''')
+        assert loop.match_by_id('loadattr2', "")   # completely folded away
 
     def test_python_contains(self):
         def main():