diff options
Diffstat (limited to 'tests/compile/fused_buffers.pyx')
-rw-r--r-- | tests/compile/fused_buffers.pyx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/compile/fused_buffers.pyx b/tests/compile/fused_buffers.pyx new file mode 100644 index 000000000..73b0315ed --- /dev/null +++ b/tests/compile/fused_buffers.pyx @@ -0,0 +1,16 @@ +# mode: compile + +# cython: test_assert_c_code_has = __Pyx_ImportNumPyArrayTypeIfAvailable +# cython: test_assert_c_code_has = ndarray + +# counterpart test to fused_no_numpy - buffer types are compared against Numpy +# dtypes as a quick test. fused_no_numpy tests that the mechanism isn't +# accidentally generated, while this just confirms that the same mechanism is +# still in use + +ctypedef fused IntOrFloat: + int + float + +def f(IntOrFloat[:] x): + return x |