[pypy-svn] r73171 - pypy/branch/cpython-extension/pypy/translator/c/test

xoraxax at codespeak.net xoraxax at codespeak.net
Tue Mar 30 16:47:09 CEST 2010


Author: xoraxax
Date: Tue Mar 30 16:47:07 2010
New Revision: 73171

Modified:
   pypy/branch/cpython-extension/pypy/translator/c/test/test_genc.py
Log:
Revert r73162, the test was broken - do not use llhelper in Python code.

Modified: pypy/branch/cpython-extension/pypy/translator/c/test/test_genc.py
==============================================================================
--- pypy/branch/cpython-extension/pypy/translator/c/test/test_genc.py	(original)
+++ pypy/branch/cpython-extension/pypy/translator/c/test/test_genc.py	Tue Mar 30 16:47:07 2010
@@ -385,39 +385,6 @@
     fn = compile(f, [])
     fn(expected_extra_mallocs=1)
 
-def test_recursive_llhelper():
-    from pypy.rpython.annlowlevel import llhelper
-    from pypy.rpython.lltypesystem import lltype
-    from pypy.rlib.objectmodel import specialize
-    from pypy.rlib.nonconst import NonConstant
-    FTPTR = lltype.Ptr(lltype.FuncType([lltype.Signed], lltype.Signed))
-    class A:
-        def __init__(self, func):
-            self.func = func
-        def _freeze_(self):
-            return True
-        @specialize.memo()
-        def get_llhelper(self):
-            return llhelper(FTPTR, lambda x: self.func(x))
-    STRUCT = lltype.Struct("foo", ("bar", FTPTR))
-    def f(s):
-        if s.bar == a_f.get_llhelper():
-            return 1
-        return 0
-    def g(x):
-        return 42
-    def chooser(x):
-        s = lltype.malloc(STRUCT, flavor="raw")
-        if x:
-            s.bar = a_f.get_llhelper()
-        else:
-            s.bar = a_g.get_llhelper()
-        return f(s)
-    a_f = A(f)
-    a_g = A(g)
-    fn = compile(chooser, [bool])
-    assert fn(True)
-
 def test_name():
     def f():
         return 3



More information about the Pypy-commit mailing list