Commit db7fbdf3 authored by Stefan Behnel's avatar Stefan Behnel

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
parent 69fc7227
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
# ticket: 466 # ticket: 466
# extension to T409 # extension to T409
cimport cython
def simple_parallel_typed(): def simple_parallel_typed():
""" """
>>> simple_parallel_typed() >>> simple_parallel_typed()
...@@ -67,3 +69,23 @@ def non_simple_rhs_malloc(): ...@@ -67,3 +69,23 @@ def non_simple_rhs_malloc():
# check copied values # check copied values
assert x[0] == c'X' assert x[0] == c'X'
assert x[1] == c'\0' 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]
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment