Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
3074c1a4
Commit
3074c1a4
authored
Jun 16, 2011
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
additional tests for cascading assignments
parent
1b0c3ae8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
0 deletions
+48
-0
tests/run/cascaded_typed_assignments_T466.pyx
tests/run/cascaded_typed_assignments_T466.pyx
+48
-0
No files found.
tests/run/cascaded_typed_assignments_T466.pyx
View file @
3074c1a4
# mode: run
# ticket: 466
# extension to T409
def
simple_parallel_typed
():
...
...
@@ -19,3 +21,49 @@ def simple_parallel_int_mix():
cdef
object
ao
,
bo
ai
,
bi
=
al
,
bl
=
ao
,
bo
=
c
=
d
=
[
1
,
2
]
return
ao
,
bo
,
ai
,
bi
,
al
,
bl
,
c
,
d
cdef
int
called
=
0
cdef
char
*
get_string
():
global
called
called
+=
1
return
"abcdefg"
def
non_simple_rhs
():
"""
>>> non_simple_rhs()
1
"""
cdef
char
*
a
,
*
b
cdef
int
orig_called
=
called
a
=
b
=
<
char
*>
get_string
()
assert
a
is
b
return
called
-
orig_called
from
libc.stdlib
cimport
malloc
,
free
def
non_simple_rhs_malloc
():
"""
>>> non_simple_rhs_malloc()
"""
cdef
char
*
a
,
*
b
,
**
c
c
=
&
b
c
[
0
]
=
a
=
<
char
*>
malloc
(
2
)
a
[
0
]
=
c
'X'
b
[
1
]
=
c
'
\
0
'
# copy from different pointers to make sure they all point to the
# same memory
cdef
char
[
2
]
x
x
[
0
]
=
b
[
0
]
x
[
1
]
=
a
[
1
]
# clean up
free
(
a
)
if
b
is
not
a
:
# shouldn't happen
free
(
b
)
# check copied values
assert
x
[
0
]
==
c
'X'
assert
x
[
1
]
==
c
'
\
0
'
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment