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

pedronis at codespeak.net pedronis at codespeak.net
Mon Jan 9 20:55:04 CET 2006


Author: pedronis
Date: Mon Jan  9 20:55:02 2006
New Revision: 21845

Modified:
   pypy/dist/pypy/translator/interactive.py
   pypy/dist/pypy/translator/test/test_interactive.py
Log:
enforce gc='boehm' for LLVM backend



Modified: pypy/dist/pypy/translator/interactive.py
==============================================================================
--- pypy/dist/pypy/translator/interactive.py	(original)
+++ pypy/dist/pypy/translator/interactive.py	Mon Jan  9 20:55:02 2006
@@ -92,7 +92,10 @@
             self.update_options(None, {'backend': backend})
         if self.driver.options.backend is None:
             raise Exception("a backend should have been specified at this point")
-        return self.driver.options.backend
+        backend = self.driver.options.backend
+        if backend == 'llvm':
+            self.update_options(None, {'gc': 'boehm'})
+        return backend
 
     # backend independent
 

Modified: pypy/dist/pypy/translator/test/test_interactive.py
==============================================================================
--- pypy/dist/pypy/translator/test/test_interactive.py	(original)
+++ pypy/dist/pypy/translator/test/test_interactive.py	Mon Jan  9 20:55:02 2006
@@ -63,11 +63,20 @@
     t = Translation(f, [int, int])
     t.source_c()
 
-    # this doesn't work, there is to be a bug in llvm backend code
-    #t = Translation(f, [int, int], backend='llvm')
-    #t.source()
-    #t = Translation(f, [int, int])
-    #t.source_llvm()
-
     t = Translation(f, [int, int])
     py.test.raises(Exception, "t.source()")
+
+def test_simple_source_llvm():
+    from pypy.translator.llvm.test.runtest import llvm_test
+    llvm_test()
+
+    def f(x,y):
+        return x+y
+
+
+    t = Translation(f, [int, int], backend='llvm')
+    t.source(gc='boehm')
+    
+    t = Translation(f, [int, int])
+    t.source_llvm()
+    



More information about the Pypy-commit mailing list