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

arigo at codespeak.net arigo at codespeak.net
Fri Oct 10 10:14:28 CEST 2008


Author: arigo
Date: Fri Oct 10 10:14:27 2008
New Revision: 58872

Modified:
   pypy/dist/pypy/translator/backendopt/mallocv.py
   pypy/dist/pypy/translator/backendopt/test/test_mallocv.py
Log:
More tests pass.


Modified: pypy/dist/pypy/translator/backendopt/mallocv.py
==============================================================================
--- pypy/dist/pypy/translator/backendopt/mallocv.py	(original)
+++ pypy/dist/pypy/translator/backendopt/mallocv.py	Fri Oct 10 10:14:27 2008
@@ -531,6 +531,13 @@
         else:
             return self.handle_default(op)
 
+    def handle_op_keepalive(self, op):
+        node = self.getnode(op.args[0])
+        if isinstance(node, VirtualSpecNode):
+            return []
+        else:
+            return self.handle_default(op)
+
     def handle_op_malloc(self, op):
         if op.result is self.v_expand_malloc:
             MALLOCTYPE = op.result.concretetype.TO

Modified: pypy/dist/pypy/translator/backendopt/test/test_mallocv.py
==============================================================================
--- pypy/dist/pypy/translator/backendopt/test/test_mallocv.py	(original)
+++ pypy/dist/pypy/translator/backendopt/test/test_mallocv.py	Fri Oct 10 10:14:27 2008
@@ -180,14 +180,12 @@
         self.check(fn2, [int, int], [-6, 7], -13)
 
     def test_fn3(self):
-        py.test.skip("redo me")
         def fn3(x):
             a, ((b, c), d, e) = x+1, ((x+2, x+3), x+4, x+5)
             return a+b+c+d+e
         self.check(fn3, [int], [10], 65)
 
     def test_fn4(self):
-        py.test.skip("redo me")
         class A:
             pass
         class B(A):
@@ -201,7 +199,6 @@
         self.check(fn4, [int], [42], 42)
 
     def test_fn5(self):
-        py.test.skip("redo me")
         class A:
             attr = 666
         class B(A):
@@ -212,7 +209,6 @@
         self.check(fn5, [], [], 42)
 
     def test_aliasing(self):
-        py.test.skip("redo me")
         class A:
             pass
         def fn6(n):
@@ -226,7 +222,7 @@
                 a = a2
             a.x = 12
             return a1.x
-        self.check(fn6, [int], [1], 12, must_be_removed=False)
+        self.check(fn6, [int], [1], 12)
 
 
 
@@ -235,7 +231,6 @@
     #MallocRemover = LLTypeMallocRemover
 
     def test_with_keepalive(self):
-        py.test.skip("redo me")
         from pypy.rlib.objectmodel import keepalive_until_here
         def fn1(x, y):
             if x > 0:



More information about the Pypy-commit mailing list