Testcase for cdef assignments
authorDag Sverre Seljebotn <dagss@student.matnat.uio.no>
Sat, 19 Jul 2008 20:45:07 +0000 (22:45 +0200)
committerDag Sverre Seljebotn <dagss@student.matnat.uio.no>
Sat, 19 Jul 2008 20:45:07 +0000 (22:45 +0200)
tests/run/cdefassign.pyx [new file with mode: 0644]

diff --git a/tests/run/cdefassign.pyx b/tests/run/cdefassign.pyx
new file mode 100644 (file)
index 0000000..79dc345
--- /dev/null
@@ -0,0 +1,15 @@
+
+__doc__ = """
+   >>> test(1, 2)
+   4 1 2 2 0
+"""
+
+def test(x, int y):
+    if True:
+        before = 0
+    cdef int a = 4, b = x, c = y, *p = &y
+    print a, b, c, p[0], before
+
+# Also test that pruning cdefs doesn't hurt 
+def empty():
+    cdef int i