Mercurial > projects > dstress
annotate run/o/odd_bug_07_A.d @ 1320:daef239f37cf
sed'ed replacement of new:...http.d.puremagic.com/issues/ with http://d.puremagic.com/issues/show_bug.cgi?...
author | thomask |
---|---|
date | Sun, 31 Dec 2006 19:59:08 +0000 |
parents | 70a814e4a1ee |
children |
rev | line source |
---|---|
1105
70a814e4a1ee
[Issue 287] DMD optimization bug arround dynamic array length
thomask
parents:
diff
changeset
|
1 // $HeadURL$ |
70a814e4a1ee
[Issue 287] DMD optimization bug arround dynamic array length
thomask
parents:
diff
changeset
|
2 // $Date$ |
70a814e4a1ee
[Issue 287] DMD optimization bug arround dynamic array length
thomask
parents:
diff
changeset
|
3 // $Author$ |
70a814e4a1ee
[Issue 287] DMD optimization bug arround dynamic array length
thomask
parents:
diff
changeset
|
4 |
70a814e4a1ee
[Issue 287] DMD optimization bug arround dynamic array length
thomask
parents:
diff
changeset
|
5 // @author@ icee <iceelyne@gmail.com> |
70a814e4a1ee
[Issue 287] DMD optimization bug arround dynamic array length
thomask
parents:
diff
changeset
|
6 // @date@ 2006-08-14 |
1320
daef239f37cf
sed'ed replacement of new:...http.d.puremagic.com/issues/ with http://d.puremagic.com/issues/show_bug.cgi?...
thomask
parents:
1105
diff
changeset
|
7 // @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=287 |
1105
70a814e4a1ee
[Issue 287] DMD optimization bug arround dynamic array length
thomask
parents:
diff
changeset
|
8 // @desc@ [Issue 287] DMD optimization bug arround dynamic array length |
70a814e4a1ee
[Issue 287] DMD optimization bug arround dynamic array length
thomask
parents:
diff
changeset
|
9 |
70a814e4a1ee
[Issue 287] DMD optimization bug arround dynamic array length
thomask
parents:
diff
changeset
|
10 module dstress.run.o.odd_bug_07_A; |
70a814e4a1ee
[Issue 287] DMD optimization bug arround dynamic array length
thomask
parents:
diff
changeset
|
11 |
70a814e4a1ee
[Issue 287] DMD optimization bug arround dynamic array length
thomask
parents:
diff
changeset
|
12 int status; |
70a814e4a1ee
[Issue 287] DMD optimization bug arround dynamic array length
thomask
parents:
diff
changeset
|
13 |
70a814e4a1ee
[Issue 287] DMD optimization bug arround dynamic array length
thomask
parents:
diff
changeset
|
14 void validate(int a, int b){ |
70a814e4a1ee
[Issue 287] DMD optimization bug arround dynamic array length
thomask
parents:
diff
changeset
|
15 if(a != status){ |
70a814e4a1ee
[Issue 287] DMD optimization bug arround dynamic array length
thomask
parents:
diff
changeset
|
16 assert(0); |
70a814e4a1ee
[Issue 287] DMD optimization bug arround dynamic array length
thomask
parents:
diff
changeset
|
17 } |
70a814e4a1ee
[Issue 287] DMD optimization bug arround dynamic array length
thomask
parents:
diff
changeset
|
18 status += 4; |
70a814e4a1ee
[Issue 287] DMD optimization bug arround dynamic array length
thomask
parents:
diff
changeset
|
19 |
70a814e4a1ee
[Issue 287] DMD optimization bug arround dynamic array length
thomask
parents:
diff
changeset
|
20 if(b != status){ |
70a814e4a1ee
[Issue 287] DMD optimization bug arround dynamic array length
thomask
parents:
diff
changeset
|
21 assert(0); |
70a814e4a1ee
[Issue 287] DMD optimization bug arround dynamic array length
thomask
parents:
diff
changeset
|
22 } |
70a814e4a1ee
[Issue 287] DMD optimization bug arround dynamic array length
thomask
parents:
diff
changeset
|
23 } |
70a814e4a1ee
[Issue 287] DMD optimization bug arround dynamic array length
thomask
parents:
diff
changeset
|
24 |
70a814e4a1ee
[Issue 287] DMD optimization bug arround dynamic array length
thomask
parents:
diff
changeset
|
25 int main(){ |
70a814e4a1ee
[Issue 287] DMD optimization bug arround dynamic array length
thomask
parents:
diff
changeset
|
26 int x = 0; |
70a814e4a1ee
[Issue 287] DMD optimization bug arround dynamic array length
thomask
parents:
diff
changeset
|
27 int y = 0; |
70a814e4a1ee
[Issue 287] DMD optimization bug arround dynamic array length
thomask
parents:
diff
changeset
|
28 char[] sa = "abcd"; |
70a814e4a1ee
[Issue 287] DMD optimization bug arround dynamic array length
thomask
parents:
diff
changeset
|
29 |
70a814e4a1ee
[Issue 287] DMD optimization bug arround dynamic array length
thomask
parents:
diff
changeset
|
30 for(int i = 0; i < 10; i++){ |
70a814e4a1ee
[Issue 287] DMD optimization bug arround dynamic array length
thomask
parents:
diff
changeset
|
31 y = x + sa.length; |
70a814e4a1ee
[Issue 287] DMD optimization bug arround dynamic array length
thomask
parents:
diff
changeset
|
32 validate(x, y); |
70a814e4a1ee
[Issue 287] DMD optimization bug arround dynamic array length
thomask
parents:
diff
changeset
|
33 x = y; |
70a814e4a1ee
[Issue 287] DMD optimization bug arround dynamic array length
thomask
parents:
diff
changeset
|
34 |
70a814e4a1ee
[Issue 287] DMD optimization bug arround dynamic array length
thomask
parents:
diff
changeset
|
35 y = x + sa.length; |
70a814e4a1ee
[Issue 287] DMD optimization bug arround dynamic array length
thomask
parents:
diff
changeset
|
36 validate(x, y); |
70a814e4a1ee
[Issue 287] DMD optimization bug arround dynamic array length
thomask
parents:
diff
changeset
|
37 x = y; |
70a814e4a1ee
[Issue 287] DMD optimization bug arround dynamic array length
thomask
parents:
diff
changeset
|
38 } |
70a814e4a1ee
[Issue 287] DMD optimization bug arround dynamic array length
thomask
parents:
diff
changeset
|
39 |
70a814e4a1ee
[Issue 287] DMD optimization bug arround dynamic array length
thomask
parents:
diff
changeset
|
40 if(status != 80){ |
70a814e4a1ee
[Issue 287] DMD optimization bug arround dynamic array length
thomask
parents:
diff
changeset
|
41 assert(0); |
70a814e4a1ee
[Issue 287] DMD optimization bug arround dynamic array length
thomask
parents:
diff
changeset
|
42 } |
70a814e4a1ee
[Issue 287] DMD optimization bug arround dynamic array length
thomask
parents:
diff
changeset
|
43 |
70a814e4a1ee
[Issue 287] DMD optimization bug arround dynamic array length
thomask
parents:
diff
changeset
|
44 return 0; |
70a814e4a1ee
[Issue 287] DMD optimization bug arround dynamic array length
thomask
parents:
diff
changeset
|
45 } |