annotate run/f/forward_reference_19_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 e489e020a55d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1437
e489e020a55d r7385@birke: tk | 2007-03-29 15:34:13 +0200
thomask
parents:
diff changeset
1 // $HeadURL$
e489e020a55d r7385@birke: tk | 2007-03-29 15:34:13 +0200
thomask
parents:
diff changeset
2 // $Date$
e489e020a55d r7385@birke: tk | 2007-03-29 15:34:13 +0200
thomask
parents:
diff changeset
3 // $Author$
e489e020a55d r7385@birke: tk | 2007-03-29 15:34:13 +0200
thomask
parents:
diff changeset
4
e489e020a55d r7385@birke: tk | 2007-03-29 15:34:13 +0200
thomask
parents:
diff changeset
5 // @author@ <vlasov@scatt.com>
e489e020a55d r7385@birke: tk | 2007-03-29 15:34:13 +0200
thomask
parents:
diff changeset
6 // @date@ 2007-03-12
e489e020a55d r7385@birke: tk | 2007-03-29 15:34:13 +0200
thomask
parents:
diff changeset
7 // @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1058
e489e020a55d r7385@birke: tk | 2007-03-29 15:34:13 +0200
thomask
parents:
diff changeset
8 // @desc@ [Issue 1058] DMD hangs with 100% CPU - member function returning forward-referenced struct before constructor
e489e020a55d r7385@birke: tk | 2007-03-29 15:34:13 +0200
thomask
parents:
diff changeset
9
e489e020a55d r7385@birke: tk | 2007-03-29 15:34:13 +0200
thomask
parents:
diff changeset
10 module dstress.run.f.forward_reference_19_C;
e489e020a55d r7385@birke: tk | 2007-03-29 15:34:13 +0200
thomask
parents:
diff changeset
11
e489e020a55d r7385@birke: tk | 2007-03-29 15:34:13 +0200
thomask
parents:
diff changeset
12 class A{
e489e020a55d r7385@birke: tk | 2007-03-29 15:34:13 +0200
thomask
parents:
diff changeset
13 B x;
e489e020a55d r7385@birke: tk | 2007-03-29 15:34:13 +0200
thomask
parents:
diff changeset
14
e489e020a55d r7385@birke: tk | 2007-03-29 15:34:13 +0200
thomask
parents:
diff changeset
15 this(){
e489e020a55d r7385@birke: tk | 2007-03-29 15:34:13 +0200
thomask
parents:
diff changeset
16 }
e489e020a55d r7385@birke: tk | 2007-03-29 15:34:13 +0200
thomask
parents:
diff changeset
17
e489e020a55d r7385@birke: tk | 2007-03-29 15:34:13 +0200
thomask
parents:
diff changeset
18 B b(){
e489e020a55d r7385@birke: tk | 2007-03-29 15:34:13 +0200
thomask
parents:
diff changeset
19 return x;
e489e020a55d r7385@birke: tk | 2007-03-29 15:34:13 +0200
thomask
parents:
diff changeset
20 }
e489e020a55d r7385@birke: tk | 2007-03-29 15:34:13 +0200
thomask
parents:
diff changeset
21 }
e489e020a55d r7385@birke: tk | 2007-03-29 15:34:13 +0200
thomask
parents:
diff changeset
22
e489e020a55d r7385@birke: tk | 2007-03-29 15:34:13 +0200
thomask
parents:
diff changeset
23 struct B{
e489e020a55d r7385@birke: tk | 2007-03-29 15:34:13 +0200
thomask
parents:
diff changeset
24 int dummy;
e489e020a55d r7385@birke: tk | 2007-03-29 15:34:13 +0200
thomask
parents:
diff changeset
25 }
e489e020a55d r7385@birke: tk | 2007-03-29 15:34:13 +0200
thomask
parents:
diff changeset
26
e489e020a55d r7385@birke: tk | 2007-03-29 15:34:13 +0200
thomask
parents:
diff changeset
27 int main(){
e489e020a55d r7385@birke: tk | 2007-03-29 15:34:13 +0200
thomask
parents:
diff changeset
28 A a = new A();
e489e020a55d r7385@birke: tk | 2007-03-29 15:34:13 +0200
thomask
parents:
diff changeset
29 B b;
e489e020a55d r7385@birke: tk | 2007-03-29 15:34:13 +0200
thomask
parents:
diff changeset
30 b.dummy = 0x12EF34AB;
e489e020a55d r7385@birke: tk | 2007-03-29 15:34:13 +0200
thomask
parents:
diff changeset
31 a.x = b;
e489e020a55d r7385@birke: tk | 2007-03-29 15:34:13 +0200
thomask
parents:
diff changeset
32 if(0x12EF34AB != a.b().dummy){
e489e020a55d r7385@birke: tk | 2007-03-29 15:34:13 +0200
thomask
parents:
diff changeset
33 assert(0);
e489e020a55d r7385@birke: tk | 2007-03-29 15:34:13 +0200
thomask
parents:
diff changeset
34 }
e489e020a55d r7385@birke: tk | 2007-03-29 15:34:13 +0200
thomask
parents:
diff changeset
35
e489e020a55d r7385@birke: tk | 2007-03-29 15:34:13 +0200
thomask
parents:
diff changeset
36 return 0;
e489e020a55d r7385@birke: tk | 2007-03-29 15:34:13 +0200
thomask
parents:
diff changeset
37 }