[pypy-svn] r52751 - pypy/branch/jit-hotpath/pypy/jit/tl

cfbolz at codespeak.net cfbolz at codespeak.net
Wed Mar 19 23:57:08 CET 2008


Author: cfbolz
Date: Wed Mar 19 23:57:03 2008
New Revision: 52751

Modified:
   pypy/branch/jit-hotpath/pypy/jit/tl/tiny2_hotpath.py
Log:
a fibonacci that just outputs the final result


Modified: pypy/branch/jit-hotpath/pypy/jit/tl/tiny2_hotpath.py
==============================================================================
--- pypy/branch/jit-hotpath/pypy/jit/tl/tiny2_hotpath.py	(original)
+++ pypy/branch/jit-hotpath/pypy/jit/tl/tiny2_hotpath.py	Wed Mar 19 23:57:03 2008
@@ -246,3 +246,10 @@
 def test_fibonacci():
     res = interpret(FIBONACCI, [IntBox(1), IntBox(1), IntBox(10)])
     assert repr(res) == "Fibonacci numbers: 1 1 2 3 5 8 13 21 34 55"
+
+
+FIBONACCI_SINGLE = """#3 1 SUB ->#3 { #2 #1 #2 ADD ->#2 ->#1 #3 1 SUB ->#3 #3 } #1""".split()
+
+def test_fibonacci_single():
+    res = interpret(FIBONACCI_SINGLE, [IntBox(1), IntBox(1), IntBox(11)])
+    assert repr(res) == "89"



More information about the Pypy-commit mailing list