diff options
Diffstat (limited to 'tests/compile/pxd_mangling_names.srctree')
-rw-r--r-- | tests/compile/pxd_mangling_names.srctree | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/tests/compile/pxd_mangling_names.srctree b/tests/compile/pxd_mangling_names.srctree new file mode 100644 index 000000000..3797fc0f9 --- /dev/null +++ b/tests/compile/pxd_mangling_names.srctree @@ -0,0 +1,46 @@ +# mode: compile +# ticket: 2940 + +PYTHON setup.py build_ext --inplace +PYTHON -c "import a; a.test()" + +######## setup.py ######## + +from Cython.Build import cythonize +from Cython.Distutils.extension import Extension +from distutils.core import setup + +setup( + ext_modules=cythonize([Extension("a", ["a.py", "b.c"])]), +) + +######## a.pxd ######## + +cdef public int foo() + +cdef extern from "b.h": + cpdef int bar() + +######## a.py ######## + +def foo(): + return 42 + +def test(): + assert bar() == 42 + +######## b.h ######## + +#ifndef B_H +#define B_H + +int bar(); + +#endif + +######## b.c ######## + +#include "a.h" + +int bar() { return foo(); } + |