[pypy-svn] r45992 - pypy/branch/pypy-more-rtti-inprogress/translator/c/test

pedronis at codespeak.net pedronis at codespeak.net
Sun Aug 26 13:47:59 CEST 2007


Author: pedronis
Date: Sun Aug 26 13:47:59 2007
New Revision: 45992

Modified:
   pypy/branch/pypy-more-rtti-inprogress/translator/c/test/test_exceptiontransform.py
Log:
show the problem with the wrong assumption of exception transform vs. llexternals



Modified: pypy/branch/pypy-more-rtti-inprogress/translator/c/test/test_exceptiontransform.py
==============================================================================
--- pypy/branch/pypy-more-rtti-inprogress/translator/c/test/test_exceptiontransform.py	(original)
+++ pypy/branch/pypy-more-rtti-inprogress/translator/c/test/test_exceptiontransform.py	Sun Aug 26 13:47:59 2007
@@ -2,7 +2,7 @@
 from pypy.translator.translator import TranslationContext, graphof
 from pypy.translator.simplify import join_blocks
 from pypy.translator.c import exceptiontransform, genc, gc
-from pypy.objspace.flow.model import c_last_exception
+from pypy.objspace.flow.model import c_last_exception, summary
 from pypy.rpython.test.test_llinterp import get_interpreter
 from pypy.translator.c.test.test_genc import compile
 from pypy import conftest
@@ -201,3 +201,21 @@
     etrafo.create_exception_handling(g)
     ops = dict.fromkeys([o.opname for b, o in g.iterblockops()])
     assert 'zero_gc_pointers_inside' in ops
+
+
+def test_llexternal():
+    py.test.skip("WIP")
+    from pypy.rpython.lltypesystem.rffi import llexternal
+    from pypy.rpython.lltypesystem import lltype
+    z = llexternal('z', [lltype.Signed], lltype.Signed)
+    def f(x):
+        y = -1
+        if x > 0:
+            y = z(x)
+        return y + x
+
+    t,g = transform_func(f, [int])
+    # llexternals normally should not raise, the graph should have no exception
+    # checking
+    assert summary(g) == {'int_gt': 1, 'int_add': 1, 'direct_call': 1}
+



More information about the Pypy-commit mailing list