diff options
Diffstat (limited to 'tests/compile/volatile.pyx')
-rw-r--r-- | tests/compile/volatile.pyx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/compile/volatile.pyx b/tests/compile/volatile.pyx new file mode 100644 index 000000000..d69d8b355 --- /dev/null +++ b/tests/compile/volatile.pyx @@ -0,0 +1,17 @@ +# mode: compile + +cdef volatile int x = 1 + +cdef const volatile char* greeting1 = "hello world" +cdef volatile const char* greeting2 = "goodbye" + + +cdef extern from "stdlib.h": + volatile void* malloc(size_t) + +cdef volatile long* test(volatile size_t s): + cdef volatile long* arr = <long*><volatile long*>malloc(s) + return arr + + +test(64) |