Author: Maciej Fijalkowski <fij...@gmail.com>
Branch: jitcounter-on-function
Changeset: r44964:ff117891669d
Date: 2011-06-16 10:18 +0200
http://bitbucket.org/pypy/pypy/changeset/ff117891669d/

Log:    a test that trace from start actually works

diff --git a/pypy/jit/metainterp/test/test_recursive.py 
b/pypy/jit/metainterp/test/test_recursive.py
--- a/pypy/jit/metainterp/test/test_recursive.py
+++ b/pypy/jit/metainterp/test/test_recursive.py
@@ -1194,6 +1194,19 @@
                 i -= 1
         self.meta_interp(portal, [0, 10], inline=True)
 
+    def test_trace_from_start(self):
+        driver = JitDriver(greens = ['c'], reds = ['i'])
+
+        def portal(c, i):
+            while i > 0:
+                driver.can_enter_jit(c=c, i=i)
+                driver.jit_merge_point(c=c, i=i)
+                portal(c, i - 1)
+                break
+
+        self.meta_interp(portal, [10, 10], inline=True)
+        self.check_tree_loop_count(1)
+        self.check_loop_count(0)
 
 class TestLLtype(RecursiveTests, LLJitMixin):
     pass
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to