Mercurial > projects > dstress
annotate run/foreach_13.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 | 20d8ee6523e1 |
children |
rev | line source |
---|---|
374 | 1 // $HeadURL$ |
2 // $Date$ | |
3 // $Author$ | |
0 | 4 |
374 | 5 module dstress.run.foreach_13; |
0 | 6 |
7 int main(){ | |
18 | 8 char[] array="abc".dup; |
0 | 9 int count=0; |
10 assert(count==0); | |
11 assert(array[0]=='a'); | |
12 assert(array[1]=='b'); | |
13 assert(array[2]=='c'); | |
1535 | 14 foreach(ref char value; array){ |
0 | 15 count++; |
16 value++; | |
17 } | |
18 assert(count==3); | |
19 assert(array[0]=='b'); | |
20 assert(array[1]=='c'); | |
21 assert(array[2]=='d'); | |
22 return 0; | |
23 } |