annotate nocompile/n/nested_class_04_C.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 2c10afcfcf76
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
942
00517392e540 <jarrett.billingsley@gmail.com>
thomask
parents:
diff changeset
1 // $HeadURL$
00517392e540 <jarrett.billingsley@gmail.com>
thomask
parents:
diff changeset
2 // $Date$
00517392e540 <jarrett.billingsley@gmail.com>
thomask
parents:
diff changeset
3 // $Author$
00517392e540 <jarrett.billingsley@gmail.com>
thomask
parents:
diff changeset
4
00517392e540 <jarrett.billingsley@gmail.com>
thomask
parents:
diff changeset
5 // @author@ <jarrett.billingsley@gmail.com>
00517392e540 <jarrett.billingsley@gmail.com>
thomask
parents:
diff changeset
6 // @date@ 2006-04-02
1319
81222734adf3 sed'ed replacement of new:...http.d.puremagic.co... with http://d.puremagic.com/issues/show_bug.cgi?...
thomask
parents: 1091
diff changeset
7 // @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=80
942
00517392e540 <jarrett.billingsley@gmail.com>
thomask
parents:
diff changeset
8
00517392e540 <jarrett.billingsley@gmail.com>
thomask
parents:
diff changeset
9 module dstress.run.n.nested_class_04_C;
00517392e540 <jarrett.billingsley@gmail.com>
thomask
parents:
diff changeset
10
00517392e540 <jarrett.billingsley@gmail.com>
thomask
parents:
diff changeset
11 struct Outer{
00517392e540 <jarrett.billingsley@gmail.com>
thomask
parents:
diff changeset
12 int i;
00517392e540 <jarrett.billingsley@gmail.com>
thomask
parents:
diff changeset
13
00517392e540 <jarrett.billingsley@gmail.com>
thomask
parents:
diff changeset
14 class Inner{
00517392e540 <jarrett.billingsley@gmail.com>
thomask
parents:
diff changeset
15 int x;
00517392e540 <jarrett.billingsley@gmail.com>
thomask
parents:
diff changeset
16
00517392e540 <jarrett.billingsley@gmail.com>
thomask
parents:
diff changeset
17 this(){
00517392e540 <jarrett.billingsley@gmail.com>
thomask
parents:
diff changeset
18 x = i;
00517392e540 <jarrett.billingsley@gmail.com>
thomask
parents:
diff changeset
19 }
1091
9dcac8d4e97f post DMD-0.163 review
thomask
parents: 942
diff changeset
20 }
942
00517392e540 <jarrett.billingsley@gmail.com>
thomask
parents:
diff changeset
21
1091
9dcac8d4e97f post DMD-0.163 review
thomask
parents: 942
diff changeset
22 Inner test(){
942
00517392e540 <jarrett.billingsley@gmail.com>
thomask
parents:
diff changeset
23 Inner o;
00517392e540 <jarrett.billingsley@gmail.com>
thomask
parents:
diff changeset
24
00517392e540 <jarrett.billingsley@gmail.com>
thomask
parents:
diff changeset
25 void bug(){
00517392e540 <jarrett.billingsley@gmail.com>
thomask
parents:
diff changeset
26 o = new Inner();
00517392e540 <jarrett.billingsley@gmail.com>
thomask
parents:
diff changeset
27 }
00517392e540 <jarrett.billingsley@gmail.com>
thomask
parents:
diff changeset
28
00517392e540 <jarrett.billingsley@gmail.com>
thomask
parents:
diff changeset
29 bug();
00517392e540 <jarrett.billingsley@gmail.com>
thomask
parents:
diff changeset
30
00517392e540 <jarrett.billingsley@gmail.com>
thomask
parents:
diff changeset
31 return o;
1091
9dcac8d4e97f post DMD-0.163 review
thomask
parents: 942
diff changeset
32 }
942
00517392e540 <jarrett.billingsley@gmail.com>
thomask
parents:
diff changeset
33 }
00517392e540 <jarrett.billingsley@gmail.com>
thomask
parents:
diff changeset
34
00517392e540 <jarrett.billingsley@gmail.com>
thomask
parents:
diff changeset
35 int main(){
00517392e540 <jarrett.billingsley@gmail.com>
thomask
parents:
diff changeset
36 Outer* outer = new Outer();
00517392e540 <jarrett.billingsley@gmail.com>
thomask
parents:
diff changeset
37 outer.i = 1;
00517392e540 <jarrett.billingsley@gmail.com>
thomask
parents:
diff changeset
38 Outer.Inner inner = outer.test();
00517392e540 <jarrett.billingsley@gmail.com>
thomask
parents:
diff changeset
39 outer.i = 2;
00517392e540 <jarrett.billingsley@gmail.com>
thomask
parents:
diff changeset
40
00517392e540 <jarrett.billingsley@gmail.com>
thomask
parents:
diff changeset
41 if(inner.x != 1){
00517392e540 <jarrett.billingsley@gmail.com>
thomask
parents:
diff changeset
42 assert(0);
00517392e540 <jarrett.billingsley@gmail.com>
thomask
parents:
diff changeset
43 }
00517392e540 <jarrett.billingsley@gmail.com>
thomask
parents:
diff changeset
44
00517392e540 <jarrett.billingsley@gmail.com>
thomask
parents:
diff changeset
45 return 0;
00517392e540 <jarrett.billingsley@gmail.com>
thomask
parents:
diff changeset
46 }