[pypy-svn] r35964 - in pypy/dist/pypy/jit/codegen/llvm: . test

ericvrp at codespeak.net ericvrp at codespeak.net
Sat Dec 23 09:41:21 CET 2006


Author: ericvrp
Date: Sat Dec 23 09:41:15 2006
New Revision: 35964

Modified:
   pypy/dist/pypy/jit/codegen/llvm/rgenop.py
   pypy/dist/pypy/jit/codegen/llvm/test/test_genc_ts.py
   pypy/dist/pypy/jit/codegen/llvm/test/test_operation.py
   pypy/dist/pypy/jit/codegen/llvm/test/test_rgenop.py
Log:
Skip some codegen/llvm tests when the llvm version < 2.0


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	Sat Dec 23 09:41:15 2006
@@ -6,10 +6,9 @@
 from pypy.jit.codegen.llvm import llvmjit
 from pypy.rlib.objectmodel import we_are_translated
 from pypy.jit.codegen.i386.rgenop import gc_malloc_fnaddr
-
-
 from pypy.jit.codegen.llvm.conftest import option
 
+
 LINENO       = option.lineno
 PRINT_SOURCE = option.print_source
 PRINT_DEBUG  = option.print_debug
@@ -17,6 +16,15 @@
 WORD = 4
 
 
+MINIMAL_VERSION = 2.0
+
+def llvm_version():
+    v = os.popen('llvm-as -version 2>&1').read()
+    v = ''.join([c for c in v if c.isdigit()])
+    v = int(v) / 10.0
+    return v
+
+
 class Logger:
     
     enabled = True

Modified: pypy/dist/pypy/jit/codegen/llvm/test/test_genc_ts.py
==============================================================================
--- pypy/dist/pypy/jit/codegen/llvm/test/test_genc_ts.py	(original)
+++ pypy/dist/pypy/jit/codegen/llvm/test/test_genc_ts.py	Sat Dec 23 09:41:15 2006
@@ -1,7 +1,7 @@
 import py
 from pypy.jit.codegen.i386.test.test_genc_ts import I386TimeshiftingTestMixin
 from pypy.jit.timeshifter.test import test_timeshift
-from pypy.jit.codegen.llvm.rgenop import RLLVMGenOp
+from pypy.jit.codegen.llvm.rgenop import RLLVMGenOp, llvm_version, MINIMAL_VERSION
 
 
 skip_passing = False
@@ -21,6 +21,22 @@
     def skip(self):
         py.test.skip("WIP")
 
+    def skip_too_minimal(self):
+        py.test.skip('found llvm %.1f, requires at least llvm %.1f(cvs)' % (
+            llvm_version(), MINIMAL_VERSION))
+
+    if llvm_version() < MINIMAL_VERSION:
+        test_loop_merging = skip_too_minimal
+        test_two_loops_merging = skip_too_minimal
+        test_merge_3_redconsts_before_return = skip_too_minimal
+        test_degenerated_before_return = skip_too_minimal
+        test_degenerated_before_return_2 = skip_too_minimal
+        test_setarrayitem = skip_too_minimal
+        test_degenerated_via_substructure = skip_too_minimal
+        test_merge_structures = skip_too_minimal
+        test_split_on_green_return = skip_too_minimal
+        test_normalize_indirect_call_more = skip_too_minimal
+
     if skip_passing:
         test_very_simple = skip
         test_convert_const_to_redbox = skip

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	Sat Dec 23 09:41:15 2006
@@ -1,10 +1,7 @@
 import py
 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
-
-
-#skip_unsupported_platform()
+from pypy.jit.codegen.llvm.rgenop import RLLVMGenOp, llvm_version, MINIMAL_VERSION
 
 
 class LLVMTestBasicMixin(object):
@@ -20,6 +17,20 @@
     def skip(self):
         py.test.skip('WIP')
 
+    def skip_too_minimal(self):
+        py.test.skip('found llvm %.1f, requires at least llvm %.1f(cvs)' % (
+            llvm_version(), MINIMAL_VERSION))
+
+    if llvm_version() < MINIMAL_VERSION:
+        test_arithmetic = skip_too_minimal
+        test_comparison = skip_too_minimal
+        test_char_comparison = skip_too_minimal
+        test_unichar_comparison = skip_too_minimal
+        test_char_array = skip_too_minimal
+        test_char_varsize_array = skip_too_minimal
+        test_unsigned = skip_too_minimal
+        test_float_arithmetic = skip_too_minimal
+
     test_float_pow = skip
     test_unichar_array = skip
     test_char_unichar_fields = skip

Modified: pypy/dist/pypy/jit/codegen/llvm/test/test_rgenop.py
==============================================================================
--- pypy/dist/pypy/jit/codegen/llvm/test/test_rgenop.py	(original)
+++ pypy/dist/pypy/jit/codegen/llvm/test/test_rgenop.py	Sat Dec 23 09:41:15 2006
@@ -1,5 +1,5 @@
 import py
-from pypy.jit.codegen.llvm.rgenop import RLLVMGenOp
+from pypy.jit.codegen.llvm.rgenop import RLLVMGenOp, llvm_version, MINIMAL_VERSION
 from pypy.jit.codegen.test.rgenop_tests import AbstractRGenOpTests
 from sys import platform
 
@@ -14,4 +14,13 @@
     def skip(self):
         py.test.skip('WIP')
 
+    def skip_too_minimal(self):
+        py.test.skip('found llvm %.1f, requires at least llvm %.1f(cvs)' % (
+            llvm_version(), MINIMAL_VERSION))
+
+    if llvm_version() < MINIMAL_VERSION:
+        test_goto_direct = skip_too_minimal
+        test_goto_compile = skip_too_minimal
+        test_fact_direct = skip_too_minimal
+
     test_fact_compile = skip #XXX Blocked block, introducted by this checkin (I don't understand)



More information about the Pypy-commit mailing list