Author: Carl Friedrich Bolz <cfb...@gmx.de> Branch: celldict-versions Changeset: r45338:6b534032e588 Date: 2011-07-04 15:59 +0200 http://bitbucket.org/pypy/pypy/changeset/6b534032e588/
Log: a test that a global read of a non-written global takes only a guard_not_invalidated diff --git a/pypy/module/pypyjit/test_pypy_c/test_misc.py b/pypy/module/pypyjit/test_pypy_c/test_misc.py --- a/pypy/module/pypyjit/test_pypy_c/test_misc.py +++ b/pypy/module/pypyjit/test_pypy_c/test_misc.py @@ -232,3 +232,19 @@ return total # self.run_and_check(main, []) + + + def test_global(self): + log = self.run(""" + i = 0 + globalinc = 1 + def main(n): + global i + while i < n: + l = globalinc # ID: globalread + i += l + """, [1000]) + + loop, = log.loops_by_id("globalread", is_entry_bridge=True) + op, = loop.ops_by_id("globalread") + assert op.name == "guard_not_invalidated" _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit