From a39c09ce8f439814bc3f8e4f4d43e1c77c569ab1 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Fri, 11 Jul 2008 18:21:42 +0200 Subject: [PATCH] test for C arrays and their declaration --- tests/run/carrays.pyx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 tests/run/carrays.pyx diff --git a/tests/run/carrays.pyx b/tests/run/carrays.pyx new file mode 100644 index 00000000..3a7e4537 --- /dev/null +++ b/tests/run/carrays.pyx @@ -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] -- 2.26.2