[pypy-svn] r48272 - pypy/dist/pypy/translator/backendopt/test

cfbolz at codespeak.net cfbolz at codespeak.net
Sat Nov 3 18:11:13 CET 2007


Author: cfbolz
Date: Sat Nov  3 18:11:13 2007
New Revision: 48272

Modified:
   pypy/dist/pypy/translator/backendopt/test/test_coalloc.py
Log:
another working test


Modified: pypy/dist/pypy/translator/backendopt/test/test_coalloc.py
==============================================================================
--- pypy/dist/pypy/translator/backendopt/test/test_coalloc.py	(original)
+++ pypy/dist/pypy/translator/backendopt/test/test_coalloc.py	Sat Nov  3 18:11:13 2007
@@ -172,7 +172,7 @@
         return 4
     t = check_malloc_to_coalloc(f, [], [], 4, must_remove=1)
 
-def test_coalloc_with_arg_several_creationpoints():
+def test_coalloc_with_arg_set_in_same_block():
     class A(object):
         pass
     a1 = A()
@@ -186,3 +186,18 @@
         return 4
     t = check_malloc_to_coalloc(f, [bool], [True], 4, must_remove=1)
 
+def test_coalloc_with_arg_several_creationpoints():
+    class A(object):
+        pass
+    a1 = A()
+    def g(cond, b):
+        a = A()
+        if cond:
+            b = a1
+        b.x = a
+    def f(cond):
+        a2 = A()
+        g(cond, a2)
+        return 4
+    t = check_malloc_to_coalloc(f, [bool], [True], 4, must_remove=1)
+



More information about the Pypy-commit mailing list