[pypy-commit] pypy pypy-jitdriver-greenkeys: test showing the effect

cfbolz pypy.commits at gmail.com
Tue Feb 11 08:13:30 EST 2020


Author: Carl Friedrich Bolz-Tereick <cfbolz at gmx.de>
Branch: pypy-jitdriver-greenkeys
Changeset: r98693:bdb5e618e09d
Date: 2020-02-09 22:51 +0100
http://bitbucket.org/pypy/pypy/changeset/bdb5e618e09d/

Log:	test showing the effect

diff --git a/pypy/module/pypyjit/test_pypy_c/test_generators.py b/pypy/module/pypyjit/test_pypy_c/test_generators.py
--- a/pypy/module/pypyjit/test_pypy_c/test_generators.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_generators.py
@@ -61,3 +61,13 @@
             i2 = int_sub_ovf(i1, 42)
             guard_no_overflow(descr=...)
             """)
+
+    def test_nonstd_jitdriver_distinguishes_generators(self):
+        def main():
+            # test the "contains" jitdriver, but the others are the same
+            res = (9999 in (i for i in range(20000)))
+            res += (9999 in (i for i in range(20000)))
+            return res
+        log = self.run(main, [])
+        assert len(log.loops) == 2  # as opposed to one loop, one bridge
+


More information about the pypy-commit mailing list