annotate run/f/forward_reference_20_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 ca5b18e46ec7
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1438
ca5b18e46ec7 r7386@birke: tk | 2007-03-29 15:38:42 +0200
thomask
parents:
diff changeset
1 // $HeadURL$
ca5b18e46ec7 r7386@birke: tk | 2007-03-29 15:38:42 +0200
thomask
parents:
diff changeset
2 // $Date$
ca5b18e46ec7 r7386@birke: tk | 2007-03-29 15:38:42 +0200
thomask
parents:
diff changeset
3 // $Author$
ca5b18e46ec7 r7386@birke: tk | 2007-03-29 15:38:42 +0200
thomask
parents:
diff changeset
4
ca5b18e46ec7 r7386@birke: tk | 2007-03-29 15:38:42 +0200
thomask
parents:
diff changeset
5 // @author@ Bill Baxter <wbaxter@gmail.com>
ca5b18e46ec7 r7386@birke: tk | 2007-03-29 15:38:42 +0200
thomask
parents:
diff changeset
6 // @date@ 2007-03-12
ca5b18e46ec7 r7386@birke: tk | 2007-03-29 15:38:42 +0200
thomask
parents:
diff changeset
7 // @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1055
ca5b18e46ec7 r7386@birke: tk | 2007-03-29 15:38:42 +0200
thomask
parents:
diff changeset
8 // @desc@ [Issue 1055] union forward reference "overlapping initialization" error
ca5b18e46ec7 r7386@birke: tk | 2007-03-29 15:38:42 +0200
thomask
parents:
diff changeset
9
ca5b18e46ec7 r7386@birke: tk | 2007-03-29 15:38:42 +0200
thomask
parents:
diff changeset
10 module dstress.run.f.forward_reference_20_C;
ca5b18e46ec7 r7386@birke: tk | 2007-03-29 15:38:42 +0200
thomask
parents:
diff changeset
11
ca5b18e46ec7 r7386@birke: tk | 2007-03-29 15:38:42 +0200
thomask
parents:
diff changeset
12 struct S{
ca5b18e46ec7 r7386@birke: tk | 2007-03-29 15:38:42 +0200
thomask
parents:
diff changeset
13 int y = 0x1234_5678;
ca5b18e46ec7 r7386@birke: tk | 2007-03-29 15:38:42 +0200
thomask
parents:
diff changeset
14 }
ca5b18e46ec7 r7386@birke: tk | 2007-03-29 15:38:42 +0200
thomask
parents:
diff changeset
15
ca5b18e46ec7 r7386@birke: tk | 2007-03-29 15:38:42 +0200
thomask
parents:
diff changeset
16 struct Z {
ca5b18e46ec7 r7386@birke: tk | 2007-03-29 15:38:42 +0200
thomask
parents:
diff changeset
17 union {
ca5b18e46ec7 r7386@birke: tk | 2007-03-29 15:38:42 +0200
thomask
parents:
diff changeset
18 S s;
ca5b18e46ec7 r7386@birke: tk | 2007-03-29 15:38:42 +0200
thomask
parents:
diff changeset
19 }
ca5b18e46ec7 r7386@birke: tk | 2007-03-29 15:38:42 +0200
thomask
parents:
diff changeset
20 int x = 0x9ABC_DEF0;
ca5b18e46ec7 r7386@birke: tk | 2007-03-29 15:38:42 +0200
thomask
parents:
diff changeset
21 }
ca5b18e46ec7 r7386@birke: tk | 2007-03-29 15:38:42 +0200
thomask
parents:
diff changeset
22
ca5b18e46ec7 r7386@birke: tk | 2007-03-29 15:38:42 +0200
thomask
parents:
diff changeset
23 int main(){
ca5b18e46ec7 r7386@birke: tk | 2007-03-29 15:38:42 +0200
thomask
parents:
diff changeset
24 Z z;
ca5b18e46ec7 r7386@birke: tk | 2007-03-29 15:38:42 +0200
thomask
parents:
diff changeset
25 if(0x9ABC_DEF0 != z.x){
ca5b18e46ec7 r7386@birke: tk | 2007-03-29 15:38:42 +0200
thomask
parents:
diff changeset
26 assert(0);
ca5b18e46ec7 r7386@birke: tk | 2007-03-29 15:38:42 +0200
thomask
parents:
diff changeset
27 }
ca5b18e46ec7 r7386@birke: tk | 2007-03-29 15:38:42 +0200
thomask
parents:
diff changeset
28 if(0x1234_5678 != z.s.y){
ca5b18e46ec7 r7386@birke: tk | 2007-03-29 15:38:42 +0200
thomask
parents:
diff changeset
29 assert(0);
ca5b18e46ec7 r7386@birke: tk | 2007-03-29 15:38:42 +0200
thomask
parents:
diff changeset
30 }
ca5b18e46ec7 r7386@birke: tk | 2007-03-29 15:38:42 +0200
thomask
parents:
diff changeset
31 return 0;
ca5b18e46ec7 r7386@birke: tk | 2007-03-29 15:38:42 +0200
thomask
parents:
diff changeset
32 }