[pypy-svn] r12219 - in pypy/dist/pypy: annotation rpython/test
pedronis at codespeak.net
pedronis at codespeak.net
Thu May 12 15:41:57 CEST 2005
Author: pedronis
Date: Thu May 12 15:41:57 2005
New Revision: 12219
Modified:
pypy/dist/pypy/annotation/unaryop.py
pypy/dist/pypy/rpython/test/test_llann.py
Log:
annotation for calls to func ptrs
Modified: pypy/dist/pypy/annotation/unaryop.py
==============================================================================
--- pypy/dist/pypy/annotation/unaryop.py (original)
+++ pypy/dist/pypy/annotation/unaryop.py Thu May 12 15:41:57 2005
@@ -442,3 +442,8 @@
v_lltype = annotation_to_lltype(s_value)
setattr(p.ll_ptrtype._example(), s_attr.const,
v_lltype._example())
+
+ def simple_call(p, *args_s):
+ llargs = [annotation_to_lltype(arg_s)._example() for arg_s in args_s]
+ v = p.ll_ptrtype._example()(*llargs)
+ return ll_to_annotation(v)
Modified: pypy/dist/pypy/rpython/test/test_llann.py
==============================================================================
--- pypy/dist/pypy/rpython/test/test_llann.py (original)
+++ pypy/dist/pypy/rpython/test/test_llann.py Thu May 12 15:41:57 2005
@@ -69,3 +69,13 @@
a = self.RPythonAnnotator()
s = a.build_types(llf, [])
assert s.knowntype == int
+
+ def test_funcptr(self):
+ F = FuncType((Signed,), Signed)
+ PF = NonGcPtr(F)
+ def llf(p):
+ return p(0)
+ a = self.RPythonAnnotator()
+ s = a.build_types(llf, [PF])
+ assert s.knowntype == int
+
More information about the Pypy-commit
mailing list