[pypy-svn] r15888 - in pypy/dist/pypy/translator/llvm2: . test

rxe at codespeak.net rxe at codespeak.net
Wed Aug 10 02:43:11 CEST 2005


Author: rxe
Date: Wed Aug 10 02:43:09 2005
New Revision: 15888

Modified:
   pypy/dist/pypy/translator/llvm2/opwriter.py
   pypy/dist/pypy/translator/llvm2/test/test_typed.py
Log:
Small tweak for uint_invert to work python2.3 and hacks to enable test.
Also (cosmetic) remove old comment.



Modified: pypy/dist/pypy/translator/llvm2/opwriter.py
==============================================================================
--- pypy/dist/pypy/translator/llvm2/opwriter.py	(original)
+++ pypy/dist/pypy/translator/llvm2/opwriter.py	Wed Aug 10 02:43:09 2005
@@ -165,7 +165,7 @@
                                  self.db.repr_arg(op.result),
                                  self.db.repr_arg_type(op.args[0]),
                                  self.db.repr_arg(op.args[0]), 
-                                 str((1<<32)-1))
+                                 str((1L<<32) - 1))
 
     def binaryop(self, op):
         name = self.binary_operations[op.opname]

Modified: pypy/dist/pypy/translator/llvm2/test/test_typed.py
==============================================================================
--- pypy/dist/pypy/translator/llvm2/test/test_typed.py	(original)
+++ pypy/dist/pypy/translator/llvm2/test/test_typed.py	Wed Aug 10 02:43:09 2005
@@ -7,8 +7,6 @@
 from pypy.translator.llvm2.genllvm import compile_function
 
 def test_call_five():
-    # --  the result of call_five() isn't a real list, but an rlist
-    #     that can't be converted to a PyListObject
     def wrapper():
         lst = snippet.call_five()
         res = list((len(lst), lst[0]))
@@ -328,14 +326,19 @@
     def fn(i):
         return ~i
     f = compile_function(fn, [int])
-    for i in range(-15,15):
+    for i in range(-15, 15):
         assert f(i) == fn(i)
 
 def test_uint_invert():
-    py.test.skip("not sure why uint annotated function can return -1 (pyrex?)")
     def fn(i):
-        return ~i
+        inverted = ~i
+        inverted -= sys.maxint
+        return inverted
     f = compile_function(fn, [r_uint])
-    for value in range(15):
+    for value in range(1, 15):
+        i = r_uint(value)
+        assert str(f(i)) == str(fn(i))
+    s = 0xfffffff    
+    for value in range(s, s+1024, 64):
         i = r_uint(value)
         assert str(f(i)) == str(fn(i))



More information about the Pypy-commit mailing list