summaryrefslogtreecommitdiff
path: root/tests/run/cpdef_nogil.pyx
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run/cpdef_nogil.pyx')
-rw-r--r--tests/run/cpdef_nogil.pyx19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/run/cpdef_nogil.pyx b/tests/run/cpdef_nogil.pyx
new file mode 100644
index 000000000..b44e6f551
--- /dev/null
+++ b/tests/run/cpdef_nogil.pyx
@@ -0,0 +1,19 @@
+# cython: binding=True
+# mode: run
+# tag: cyfunction
+
+cpdef int simple() nogil:
+ """
+ >>> simple()
+ 1
+ """
+ return 1
+
+
+cpdef int call_nogil():
+ """
+ >>> call_nogil()
+ 1
+ """
+ with nogil:
+ return simple()