annotate run/bug_cgcod_1489_C.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 ec5e144583ea
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
478
78025fa64bdf cgcod.c 1489
thomask
parents:
diff changeset
1 // $HeadURL$
78025fa64bdf cgcod.c 1489
thomask
parents:
diff changeset
2 // $Date$
78025fa64bdf cgcod.c 1489
thomask
parents:
diff changeset
3 // $Author$
78025fa64bdf cgcod.c 1489
thomask
parents:
diff changeset
4
78025fa64bdf cgcod.c 1489
thomask
parents:
diff changeset
5 // @author@ Kevin Bealer <Kevin_member@pathlink.com>
78025fa64bdf cgcod.c 1489
thomask
parents:
diff changeset
6 // @date@ 2005-04-24
1489
b8c0195059d9 changed nntp: URLs to http: URLs
thomask
parents: 478
diff changeset
7 // @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=3800
478
78025fa64bdf cgcod.c 1489
thomask
parents:
diff changeset
8
78025fa64bdf cgcod.c 1489
thomask
parents:
diff changeset
9 module dstress.run.bug_cgcod_1489_C;
78025fa64bdf cgcod.c 1489
thomask
parents:
diff changeset
10
78025fa64bdf cgcod.c 1489
thomask
parents:
diff changeset
11 struct S {
78025fa64bdf cgcod.c 1489
thomask
parents:
diff changeset
12 int a, b, c;
78025fa64bdf cgcod.c 1489
thomask
parents:
diff changeset
13 }
78025fa64bdf cgcod.c 1489
thomask
parents:
diff changeset
14
78025fa64bdf cgcod.c 1489
thomask
parents:
diff changeset
15 S[] x;
78025fa64bdf cgcod.c 1489
thomask
parents:
diff changeset
16
78025fa64bdf cgcod.c 1489
thomask
parents:
diff changeset
17 S bug(S s){
78025fa64bdf cgcod.c 1489
thomask
parents:
diff changeset
18 x.length = 9;
78025fa64bdf cgcod.c 1489
thomask
parents:
diff changeset
19 x[0] = s;
78025fa64bdf cgcod.c 1489
thomask
parents:
diff changeset
20 return x[0];
78025fa64bdf cgcod.c 1489
thomask
parents:
diff changeset
21 }
78025fa64bdf cgcod.c 1489
thomask
parents:
diff changeset
22
78025fa64bdf cgcod.c 1489
thomask
parents:
diff changeset
23 int main(){
78025fa64bdf cgcod.c 1489
thomask
parents:
diff changeset
24 S var;
78025fa64bdf cgcod.c 1489
thomask
parents:
diff changeset
25 var.a=2;
78025fa64bdf cgcod.c 1489
thomask
parents:
diff changeset
26
1559
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 1489
diff changeset
27 if(bug(var) != var){
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 1489
diff changeset
28 assert(0);
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 1489
diff changeset
29 }
478
78025fa64bdf cgcod.c 1489
thomask
parents:
diff changeset
30
78025fa64bdf cgcod.c 1489
thomask
parents:
diff changeset
31 return 0;
78025fa64bdf cgcod.c 1489
thomask
parents:
diff changeset
32 }
78025fa64bdf cgcod.c 1489
thomask
parents:
diff changeset
33