From: Dag Sverre Seljebotn Date: Wed, 28 Oct 2009 15:25:32 +0000 (+0100) Subject: Testcase: Coercing typedef float to complex miscompiles X-Git-Tag: 0.12.alpha0~12 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2017884431afef48850526f2a16d365407efea36;p=cython.git Testcase: Coercing typedef float to complex miscompiles --- diff --git a/tests/run/complex_numbers_T305.pyx b/tests/run/complex_numbers_T305.pyx index e25a4b35..6f0ac0c0 100644 --- a/tests/run/complex_numbers_T305.pyx +++ b/tests/run/complex_numbers_T305.pyx @@ -63,6 +63,10 @@ __doc__ = u""" >>> test_conjugate_double(2+3j) (2-3j) + + >>> test_coerce_typedef_multiply(3, 1j) + (3j) + """ #cdef extern from "complex.h": @@ -121,3 +125,6 @@ ctypedef double complex cdouble def test_conjugate_typedef(cdouble z): return z.conjugate() +ctypedef double mydouble +def test_coerce_typedef_multiply(mydouble x, double complex z): + return x * z