summaryrefslogtreecommitdiff
path: root/tests/compile/fused_no_numpy.pyx
diff options
context:
space:
mode:
Diffstat (limited to 'tests/compile/fused_no_numpy.pyx')
-rw-r--r--tests/compile/fused_no_numpy.pyx13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/compile/fused_no_numpy.pyx b/tests/compile/fused_no_numpy.pyx
new file mode 100644
index 000000000..efb49c322
--- /dev/null
+++ b/tests/compile/fused_no_numpy.pyx
@@ -0,0 +1,13 @@
+# mode: compile
+
+# cython: test_fail_if_c_code_has = __Pyx_ImportNumPyArrayTypeIfAvailable
+
+ctypedef fused IntOrFloat:
+ int
+ float
+
+# This function does not use buffers so has no reason to import numpy to
+# look up dtypes. fused_buffers.pyx is the corresponding test for the case
+# where numpy is imported
+def f(IntOrFloat x):
+ return x