[pypy-svn] r16709 - in pypy/release/0.7.x/pypy/translator/llvm: . demo test

ericvrp at codespeak.net ericvrp at codespeak.net
Sat Aug 27 11:13:04 CEST 2005


Author: ericvrp
Date: Sat Aug 27 11:13:03 2005
New Revision: 16709

Modified:
   pypy/release/0.7.x/pypy/translator/llvm/build_llvm_module.py
   pypy/release/0.7.x/pypy/translator/llvm/demo/richards.py
   pypy/release/0.7.x/pypy/translator/llvm/genllvm.py
   pypy/release/0.7.x/pypy/translator/llvm/test/runtest.py
   pypy/release/0.7.x/pypy/translator/llvm/test/test_gc.py
Log:
bit of refactoring to get test_gc to pass


Modified: pypy/release/0.7.x/pypy/translator/llvm/build_llvm_module.py
==============================================================================
--- pypy/release/0.7.x/pypy/translator/llvm/build_llvm_module.py	(original)
+++ pypy/release/0.7.x/pypy/translator/llvm/build_llvm_module.py	Sat Aug 27 11:13:03 2005
@@ -90,14 +90,14 @@
         cmds.append("llc %s %s.bc -f -o %s.s" % (EXCEPTIONS_SWITCHES, b, b))
         cmds.append("as %s.s -o %s.o" % (b, b))
         if exe_name:
-            cmds.append("gcc %s.o -static %s -lm -o %s" % (b, gc_libs, exe_name))
+            cmds.append("gcc %s.o %s -lm -ldl -o %s" % (b, gc_libs, exe_name))
         object_files.append("%s.o" % b)
     else:       #assume 64 bit platform (x86-64?)
         #this special case for x86-64 (called ia64 in llvm) can go as soon as llc supports ia64 assembly output!
         cmds.append("llc %s %s.bc -march=c -f -o %s.c" % (EXCEPTIONS_SWITCHES, b, b))
         if exe_name:
             cmds.append("gcc %s.c -c -O2 -fomit-frame-pointer" % (b,))
-            cmds.append("gcc %s.o -static %s -lm -o %s" % (b, gc_libs, exe_name))
+            cmds.append("gcc %s.o %s -lm -ldl -o %s" % (b, gc_libs, exe_name))
         source_files.append("%s.c" % b)
 
     try:

Modified: pypy/release/0.7.x/pypy/translator/llvm/demo/richards.py
==============================================================================
--- pypy/release/0.7.x/pypy/translator/llvm/demo/richards.py	(original)
+++ pypy/release/0.7.x/pypy/translator/llvm/demo/richards.py	Sat Aug 27 11:13:03 2005
@@ -360,7 +360,7 @@
 
 class Richards:
 
-    iterations = 25
+    iterations = 2
 
     def run(self):
         for i in xrange(self.iterations):

Modified: pypy/release/0.7.x/pypy/translator/llvm/genllvm.py
==============================================================================
--- pypy/release/0.7.x/pypy/translator/llvm/genllvm.py	(original)
+++ pypy/release/0.7.x/pypy/translator/llvm/genllvm.py	Sat Aug 27 11:13:03 2005
@@ -428,8 +428,3 @@
 def compile_function(function, annotation, **kwds):
     mod = compile_module(function, annotation, **kwds)
     return getattr(mod, 'pypy_' + function.func_name + "_wrapper")
-
-def compile_module_function(function, annotation, **kwds):
-    mod = compile_module(function, annotation, **kwds)
-    f = getattr(mod, 'pypy_' + function.func_name + "_wrapper")
-    return mod, f

Modified: pypy/release/0.7.x/pypy/translator/llvm/test/runtest.py
==============================================================================
--- pypy/release/0.7.x/pypy/translator/llvm/test/runtest.py	(original)
+++ pypy/release/0.7.x/pypy/translator/llvm/test/runtest.py	Sat Aug 27 11:13:03 2005
@@ -16,3 +16,11 @@
         
     mod = compile_module(function, annotation, optimize=optimize_tests, **kwds)
     return getattr(mod, 'pypy_' + function.func_name + "_wrapper")
+
+def compile_module_function(function, annotation, **kwds):
+    if not llvm_is_on_path():
+        py.test.skip("llvm not found")
+        
+    mod = compile_module(function, annotation, **kwds)
+    f = getattr(mod, 'pypy_' + function.func_name + "_wrapper")
+    return mod, f

Modified: pypy/release/0.7.x/pypy/translator/llvm/test/test_gc.py
==============================================================================
--- pypy/release/0.7.x/pypy/translator/llvm/test/test_gc.py	(original)
+++ pypy/release/0.7.x/pypy/translator/llvm/test/test_gc.py	Sat Aug 27 11:13:03 2005
@@ -2,7 +2,7 @@
 import py
 
 from pypy.translator.llvm.genllvm import use_boehm_gc
-from pypy.translator.llvm.test.runtest import compile_function
+from pypy.translator.llvm.test.runtest import compile_module_function
 
 py.log.setconsumer("genllvm", py.log.STDOUT)
 py.log.setconsumer("genllvm database prepare", None)



More information about the Pypy-commit mailing list