[pypy-svn] r62928 - pypy/branch/pyjitpl5/pypy/jit/tl

fijal at codespeak.net fijal at codespeak.net
Fri Mar 13 11:44:21 CET 2009


Author: fijal
Date: Fri Mar 13 11:44:21 2009
New Revision: 62928

Modified:
   pypy/branch/pyjitpl5/pypy/jit/tl/pypyjit_demo.py
Log:
some test functions...


Modified: pypy/branch/pyjitpl5/pypy/jit/tl/pypyjit_demo.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/tl/pypyjit_demo.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/tl/pypyjit_demo.py	Fri Mar 13 11:44:21 2009
@@ -6,7 +6,8 @@
     while i < 100:
         i = i + 3
     print i
-    assert i == 102
+    s
+    #assert i == 102
 
 def f1():
     print "simple loop with inplace_add"
@@ -17,17 +18,15 @@
     print i
     assert i == 102
 
-def f():
+def f2():
     print "range object, but outside the loop"
 
     s = 0
     for i in range(100):
-        # XXX implement inplace_add method for ints
         s = s + i
     print s
-    assert s == 4950
 
-def f():
+def f3():
     try:
         i = 100
         while i > 0:
@@ -39,4 +38,35 @@
     else:
         raise AssertionError
 
-f()
+def f4():
+    s = 0
+    for i in range(100):
+        if i % 2:
+            s += 1
+        else:
+            s += 2
+    print s
+
+def f5():
+    t = (1, 2, 3)
+    i = 0
+    while i < 1000:
+        t = t[1], t[2], t[0]
+        i += 1
+
+def f6():
+    print     "Arbitrary test function."
+    n = 5
+    i = 0
+    x = 1
+    while i<n:
+        j = 0   #ZERO
+        while j<=i:
+            j = j + 1
+            x = x + (i&j)
+        i = i + 1
+    print x
+    return x
+
+
+f5()



More information about the Pypy-commit mailing list