annotate run/u/union_16_B.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 81222734adf3
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
908
9755f3e63e3d <regan@netwin.co.nz>
thomask
parents:
diff changeset
1 // $HeadURL$
9755f3e63e3d <regan@netwin.co.nz>
thomask
parents:
diff changeset
2 // $Date$
9755f3e63e3d <regan@netwin.co.nz>
thomask
parents:
diff changeset
3 // $Author$
9755f3e63e3d <regan@netwin.co.nz>
thomask
parents:
diff changeset
4
9755f3e63e3d <regan@netwin.co.nz>
thomask
parents:
diff changeset
5 // @author@ <regan@netwin.co.nz>
9755f3e63e3d <regan@netwin.co.nz>
thomask
parents:
diff changeset
6 // @date@ 2006-03-12
1319
81222734adf3 sed'ed replacement of new:...http.d.puremagic.co... with http://d.puremagic.com/issues/show_bug.cgi?...
thomask
parents: 908
diff changeset
7 // @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=44
908
9755f3e63e3d <regan@netwin.co.nz>
thomask
parents:
diff changeset
8
9755f3e63e3d <regan@netwin.co.nz>
thomask
parents:
diff changeset
9 module dstress.run.u.union_16_B;
9755f3e63e3d <regan@netwin.co.nz>
thomask
parents:
diff changeset
10
9755f3e63e3d <regan@netwin.co.nz>
thomask
parents:
diff changeset
11 struct B {
9755f3e63e3d <regan@netwin.co.nz>
thomask
parents:
diff changeset
12 int b1;
9755f3e63e3d <regan@netwin.co.nz>
thomask
parents:
diff changeset
13 int b2;
9755f3e63e3d <regan@netwin.co.nz>
thomask
parents:
diff changeset
14 }
9755f3e63e3d <regan@netwin.co.nz>
thomask
parents:
diff changeset
15
9755f3e63e3d <regan@netwin.co.nz>
thomask
parents:
diff changeset
16 struct A {
9755f3e63e3d <regan@netwin.co.nz>
thomask
parents:
diff changeset
17 int a;
9755f3e63e3d <regan@netwin.co.nz>
thomask
parents:
diff changeset
18 union {
9755f3e63e3d <regan@netwin.co.nz>
thomask
parents:
diff changeset
19 int c;
9755f3e63e3d <regan@netwin.co.nz>
thomask
parents:
diff changeset
20 B b;
9755f3e63e3d <regan@netwin.co.nz>
thomask
parents:
diff changeset
21 }
9755f3e63e3d <regan@netwin.co.nz>
thomask
parents:
diff changeset
22
9755f3e63e3d <regan@netwin.co.nz>
thomask
parents:
diff changeset
23 new(size_t size){
9755f3e63e3d <regan@netwin.co.nz>
thomask
parents:
diff changeset
24 if(size != int.sizeof *3){
9755f3e63e3d <regan@netwin.co.nz>
thomask
parents:
diff changeset
25 assert(0);
9755f3e63e3d <regan@netwin.co.nz>
thomask
parents:
diff changeset
26 }
9755f3e63e3d <regan@netwin.co.nz>
thomask
parents:
diff changeset
27 return (new byte[size]).ptr;
9755f3e63e3d <regan@netwin.co.nz>
thomask
parents:
diff changeset
28 }
9755f3e63e3d <regan@netwin.co.nz>
thomask
parents:
diff changeset
29 }
9755f3e63e3d <regan@netwin.co.nz>
thomask
parents:
diff changeset
30
9755f3e63e3d <regan@netwin.co.nz>
thomask
parents:
diff changeset
31
9755f3e63e3d <regan@netwin.co.nz>
thomask
parents:
diff changeset
32 int main(){
9755f3e63e3d <regan@netwin.co.nz>
thomask
parents:
diff changeset
33 A* a = new A();
9755f3e63e3d <regan@netwin.co.nz>
thomask
parents:
diff changeset
34
9755f3e63e3d <regan@netwin.co.nz>
thomask
parents:
diff changeset
35 return 0;
9755f3e63e3d <regan@netwin.co.nz>
thomask
parents:
diff changeset
36 }