[pypy-svn] r35555 - in pypy/dist/pypy/jit/codegen: i386/test llvm llvm/test

ericvrp at codespeak.net ericvrp at codespeak.net
Sun Dec 10 16:00:23 CET 2006


Author: ericvrp
Date: Sun Dec 10 16:00:22 2006
New Revision: 35555

Modified:
   pypy/dist/pypy/jit/codegen/i386/test/test_operation.py
   pypy/dist/pypy/jit/codegen/llvm/rgenop.py
   pypy/dist/pypy/jit/codegen/llvm/test/test_llvmjit.py
   pypy/dist/pypy/jit/codegen/llvm/test/test_operation.py
Log:
Actually share the operation tests. Still disabled because too many llvm operation missing.


Modified: pypy/dist/pypy/jit/codegen/i386/test/test_operation.py
==============================================================================
--- pypy/dist/pypy/jit/codegen/i386/test/test_operation.py	(original)
+++ pypy/dist/pypy/jit/codegen/i386/test/test_operation.py	Sun Dec 10 16:00:22 2006
@@ -42,9 +42,11 @@
         return tuple(map(conv, RI386GenOp.varsizeAllocToken(A)))
 
 
-class TestBasic:
+class I386TestBasicMixin(object):
     RGenOp = RGenOpPacked
+    
 
+class BasicTests(object):
     def rgen(self, ll_function, argtypes):
         t = TranslationContext()
         t.buildannotator().build_types(ll_function, argtypes)
@@ -221,7 +223,6 @@
             assert fp(25, 3) == fn(25, 3)
 
     def test_float_arithmetic(self):
-        py.test.skip("floats in codegen/i386")
         for fn in [lambda x, y: bool(y),
                    lambda x, y: bool(y - 2.0),
                    lambda x, y: x + y,
@@ -238,3 +239,9 @@
             fp = self.rgen(fn, [float, float])
             assert fp(40.0, 2.0) == fn(40.0, 2.0)
             assert fp(25.125, 1.5) == fn(25.125, 1.5)
+
+
+class TestBasic(I386TestBasicMixin,
+                BasicTests):
+    pass
+

Modified: pypy/dist/pypy/jit/codegen/llvm/rgenop.py
==============================================================================
--- pypy/dist/pypy/jit/codegen/llvm/rgenop.py	(original)
+++ pypy/dist/pypy/jit/codegen/llvm/rgenop.py	Sun Dec 10 16:00:22 2006
@@ -1,3 +1,4 @@
+import py
 from pypy.rlib.objectmodel import specialize
 from pypy.rpython.lltypesystem import lltype, llmemory
 from pypy.jit.codegen.model import AbstractRGenOp, GenLabel, GenBuilder
@@ -470,6 +471,8 @@
             return 'int*'
         elif T is llmemory.Address:
             return 'int*'
+        if T is lltype.Float:
+            py.test.skip("not implemented: floats in the llvm back-end")
         elif T is lltype.Bool:
             return 'bool'
         else:

Modified: pypy/dist/pypy/jit/codegen/llvm/test/test_llvmjit.py
==============================================================================
--- pypy/dist/pypy/jit/codegen/llvm/test/test_llvmjit.py	(original)
+++ pypy/dist/pypy/jit/codegen/llvm/test/test_llvmjit.py	Sun Dec 10 16:00:22 2006
@@ -1,5 +1,4 @@
 import py
-from sys import platform
 from os.path import dirname, join
 from pypy.translator.c.test.test_genc import compile
 from pypy.jit.codegen.llvm import llvmjit
@@ -10,6 +9,12 @@
     py.test.skip("can not load libllvmjit library (see ../README.TXT)")
 
 #
+def skip_unsupported_platform():
+    from sys import platform
+    if platform == 'darwin':
+        py.test.skip('dynamic vs. static library issue on Darwin. see: http://www.cocoadev.com/index.pl?ApplicationLinkingIssues for more information (FIXME)')
+
+#
 llsquare = '''int %square(int %n) {
     %n2 = mul int %n, %n
     ret int %n2
@@ -237,9 +242,7 @@
     pass
     
 def test_execute_translation(): #put this one last because it takes the most time
-    if platform == 'darwin':
-        py.test.skip('dynamic vs. static library issue on Darwin. see: http://www.cocoadev.com/index.pl?ApplicationLinkingIssues for more information (FIXME)')
-
+    skip_unsupported_platform()
     llvmjit.restart()
     def f(x):
         return execute(llsquare, 'square', x + 5)

Modified: pypy/dist/pypy/jit/codegen/llvm/test/test_operation.py
==============================================================================
--- pypy/dist/pypy/jit/codegen/llvm/test/test_operation.py	(original)
+++ pypy/dist/pypy/jit/codegen/llvm/test/test_operation.py	Sun Dec 10 16:00:22 2006
@@ -1,12 +1,18 @@
 import py
-from pypy.jit.codegen.i386.test.test_operation import TestBasic
+from pypy.jit.codegen.llvm.test.test_llvmjit import skip_unsupported_platform
+from pypy.jit.codegen.i386.test.test_operation import BasicTests
 from pypy.jit.codegen.llvm.rgenop import RLLVMGenOp
 
-py.test.skip("WIP")
 
-class LLVMTestBasic(TestBasic):
+skip_unsupported_platform()
+py.test.skip('WIP')
+
+class LLVMTestBasicMixin(object):
     RGenOp = RLLVMGenOp
 
+class TestBasic(LLVMTestBasicMixin,
+                BasicTests):
+
     # for the individual tests see
     # ====> ../../../i386/test/test_operation.py
 



More information about the Pypy-commit mailing list