Mercurial > projects > dstress
annotate run/foreach_24.d @ 1125:a929acac9127
various test case fixes
author | thomask |
---|---|
date | Wed, 06 Sep 2006 05:07:33 +0000 |
parents | 8c18b61cd43d |
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 } |