summaryrefslogtreecommitdiff
path: root/tests/compile/cppenum.pyx
diff options
context:
space:
mode:
Diffstat (limited to 'tests/compile/cppenum.pyx')
-rw-r--r--tests/compile/cppenum.pyx31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/compile/cppenum.pyx b/tests/compile/cppenum.pyx
new file mode 100644
index 000000000..8431ac83b
--- /dev/null
+++ b/tests/compile/cppenum.pyx
@@ -0,0 +1,31 @@
+# mode: compile
+# tag: cpp,cpp11
+
+
+cpdef enum class Spam:
+ a, b
+ c
+ d
+ e
+ f = 42
+
+
+cpdef enum class Cheese(unsigned int):
+ x = 1
+ y = 2
+
+
+cdef enum struct parrot_state:
+ alive = 1
+ dead = 0
+
+
+cdef void eggs():
+ cdef Spam s1
+ s1 = Spam.a
+ s2 = Spam.b
+
+ cdef Cheese c1
+ c1 = Cheese.x
+
+eggs()