annotate run/foreach_07.d @ 1576:b3e16c86558e
[Issue 1398] New: GDC doesn't generate correct code
<mariusmuja@gmail.com>
2007-08-04
http://d.puremagic.com/issues/show_bug.cgi?id=1398
author |
thomask |
date |
Thu, 21 Feb 2008 15:20:08 +0000 |
parents |
f87ba6507260 |
children |
|
rev |
line source |
374
|
1 // $HeadURL$
|
|
2 // $Date$
|
|
3 // $Author$
|
0
|
4
|
374
|
5 module dstress.run.foreach_07;
|
0
|
6
|
|
7 int main(){
|
|
8 dchar[] array="\u2260";
|
|
9 int test=0;
|
|
10 int count=0;
|
|
11 assert(count==0);
|
|
12 foreach(int index, char obj; array){
|
|
13 test+=obj;
|
|
14 count++;
|
|
15 }
|
|
16 assert(count==3);
|
|
17 assert(test==0x20b);
|
|
18 return 0;
|
1
|
19 }
|