[pypy-svn] r14264 - pypy/dist/pypy/translator/llvm2/test

cfbolz at codespeak.net cfbolz at codespeak.net
Tue Jul 5 12:16:49 CEST 2005


Author: cfbolz
Date: Tue Jul  5 12:16:49 2005
New Revision: 14264

Modified:
   pypy/dist/pypy/translator/llvm2/test/test_genllvm.py
Log:
added (passing) test for global tuples


Modified: pypy/dist/pypy/translator/llvm2/test/test_genllvm.py
==============================================================================
--- pypy/dist/pypy/translator/llvm2/test/test_genllvm.py	(original)
+++ pypy/dist/pypy/translator/llvm2/test/test_genllvm.py	Tue Jul  5 12:16:49 2005
@@ -227,6 +227,20 @@
     f = compile_function(nested_tuple, [int])
     assert f(4) == 4
 
+def test_prebuilt_tuples():
+    t1 = (1,2,3,4)
+    t2 = (5,6,7,8)
+    def callee_tuple(t):
+        return t[0]
+    def caller_tuple(i):
+        if i:
+            return callee_tuple(t1) + i
+        else:
+            return callee_tuple(t2) + i
+    f = compile_function(caller_tuple, [int])
+    assert f(0) == 5
+    assert f(1) == 2
+
 def test_pbc_fns(): 
     def f2(x):
          return x+1



More information about the Pypy-commit mailing list