--HG--
rename : tests/compile/coercearraytoptr.pyx => tests/run/coercearraytoptr.pyx
+++ /dev/null
-cdef extern void spam(char *s)
-
-cdef struct Grail:
- char silly[42]
-
-cdef void eggs():
- cdef char silly[42]
- cdef Grail grail
- spam(silly)
- spam(grail.silly)
-
-eggs()
--- /dev/null
+
+cdef char* cstring = "abcdefg"
+
+cdef void spam(char *target):
+ cdef char* s = cstring
+ while s[0]:
+ target[0] = s[0]
+ s += 1
+ target += 1
+ target[0] = c'\0'
+
+cdef struct Grail:
+ char silly[42]
+
+def eggs():
+ """
+ >>> print(str(eggs()).replace("b'", "'"))
+ ('abcdefg', 'abcdefg')
+ """
+ cdef char silly[42]
+ cdef Grail grail
+ spam(silly)
+ spam(grail.silly)
+ return silly, grail.silly