Mercurial > projects > dstress
annotate run/InExpression_02.d @ 1630:d0efa3ae5522 default tip
run/mini/naked_asm5: New x86_64 ABI passes the arguments in reverse order.
author | David Nadlinger <code@klickverbot.at> |
---|---|
date | Sat, 23 Apr 2011 22:57:32 +0200 |
parents | 557e7af55dfc |
children |
rev | line source |
---|---|
180 | 1 // $HeadURL$ |
2 // $Date$ | |
3 // $Author$ | |
4 | |
5 module dstress.run.InExpression_02; | |
6 | |
7 int main(){ | |
8 int value=1; | |
9 char[] key = "eins"; | |
10 int[char[]] array; | |
11 | |
12 array[key]=value; | |
13 int* ptr = key in array; | |
14 | |
312
557e7af55dfc
associative arrays store copies (native, struct) and references (class)
thomask
parents:
180
diff
changeset
|
15 assert(value == *ptr); |
557e7af55dfc
associative arrays store copies (native, struct) and references (class)
thomask
parents:
180
diff
changeset
|
16 |
557e7af55dfc
associative arrays store copies (native, struct) and references (class)
thomask
parents:
180
diff
changeset
|
17 value=2; |
557e7af55dfc
associative arrays store copies (native, struct) and references (class)
thomask
parents:
180
diff
changeset
|
18 assert(value == 2); |
557e7af55dfc
associative arrays store copies (native, struct) and references (class)
thomask
parents:
180
diff
changeset
|
19 assert(*ptr == 1); |
557e7af55dfc
associative arrays store copies (native, struct) and references (class)
thomask
parents:
180
diff
changeset
|
20 |
557e7af55dfc
associative arrays store copies (native, struct) and references (class)
thomask
parents:
180
diff
changeset
|
21 *ptr = 3; |
557e7af55dfc
associative arrays store copies (native, struct) and references (class)
thomask
parents:
180
diff
changeset
|
22 assert(value == 2); |
557e7af55dfc
associative arrays store copies (native, struct) and references (class)
thomask
parents:
180
diff
changeset
|
23 assert(*ptr == 3); |
180 | 24 |
25 return 0; | |
26 } |