test for C arrays and their declaration
authorStefan Behnel <scoder@users.berlios.de>
Fri, 11 Jul 2008 16:21:42 +0000 (18:21 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Fri, 11 Jul 2008 16:21:42 +0000 (18:21 +0200)
tests/run/carrays.pyx [new file with mode: 0644]

diff --git a/tests/run/carrays.pyx b/tests/run/carrays.pyx
new file mode 100644 (file)
index 0000000..3a7e453
--- /dev/null
@@ -0,0 +1,15 @@
+__doc__ = """
+>>> test()
+2
+"""
+
+def test():
+    cdef int x[2][2]
+    x[0][0] = 1
+    x[0][1] = 2
+    x[1][0] = 3
+    x[1][1] = 4
+    return f(x)[1]
+
+cdef int* f(int x[2][2]):
+    return x[0]