Testcase: Coercing typedef float to complex miscompiles
authorDag Sverre Seljebotn <dagss@student.matnat.uio.no>
Wed, 28 Oct 2009 15:25:32 +0000 (16:25 +0100)
committerDag Sverre Seljebotn <dagss@student.matnat.uio.no>
Wed, 28 Oct 2009 15:25:32 +0000 (16:25 +0100)
tests/run/complex_numbers_T305.pyx

index e25a4b3570c1cac1de7aced546787431dcac36ec..6f0ac0c061b5a5e80c6842bd034648e67006ecbb 100644 (file)
@@ -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