summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Behnel <stefan_ml@behnel.de>2012-11-18 07:16:45 +0100
committerStefan Behnel <stefan_ml@behnel.de>2012-11-18 07:16:45 +0100
commitdb7fbdf35ed40a006886ad6f462ec174899569b6 (patch)
tree1ea87dd3910653eb34e15814256d24122339c360
parent69fc72270168ae465ce8352ad7a628cd41273799 (diff)
downloadcython-db7fbdf35ed40a006886ad6f462ec174899569b6.tar.gz
add test for temp type adaptation from C array to C pointer type
--HG-- extra : transplant_source : %08%F6%88rE%C7%F5%CD.%9Ad%244m%0Cw%8C%25g%C0
-rw-r--r--tests/run/cascaded_typed_assignments_T466.pyx22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/run/cascaded_typed_assignments_T466.pyx b/tests/run/cascaded_typed_assignments_T466.pyx
index 0e34c12a7..5ae0d8564 100644
--- a/tests/run/cascaded_typed_assignments_T466.pyx
+++ b/tests/run/cascaded_typed_assignments_T466.pyx
@@ -2,6 +2,8 @@
# ticket: 466
# extension to T409
+cimport cython
+
def simple_parallel_typed():
"""
>>> simple_parallel_typed()
@@ -67,3 +69,23 @@ def non_simple_rhs_malloc():
# check copied values
assert x[0] == c'X'
assert x[1] == c'\0'
+
+@cython.test_assert_path_exists(
+ '//CascadedAssignmentNode',
+ '//CascadedAssignmentNode//CoerceToTempNode',
+ '//CascadedAssignmentNode//CoerceToTempNode[@type.is_ptr]')
+def assign_carray():
+ """
+ assign_carray()
+ (1, 2, 3)
+ """
+ cdef int *b, *c
+ cdef int[3] a
+ a[0] = 1
+ a[1] = 2
+ a[2] = 3
+
+ b = c = a+1
+ assert b[0] == 2
+ assert c[1] == 3
+ return a[0], b[0], c[1]