Mercurial > projects > dstress
annotate run/foreach_24.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 | a929acac9127 |
children |
rev | line source |
---|---|
198 | 1 // $HeadURL$ |
2 // $Date$ | |
3 // $Author$ | |
4 | |
5 module dstress.compile.foreach_24; | |
6 | |
7 int main(){ | |
8 int[] x; | |
9 x.length=3; | |
10 x[0]=9; | |
11 x[1]=7; | |
12 x[2]=11; | |
13 | |
14 int y=0; | |
1125 | 15 foreach(int index, int z; x){ |
16 y += z; | |
198 | 17 } |
1125 | 18 if(y != 27){ |
19 assert(0); | |
20 } | |
198 | 21 |
22 return 0; | |
23 } |