annotate run/o/odd_bug_09_A.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 1ee9a0dd42d9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1140
092188799a91 Incorrect code generation -O2 gdc
thomask
parents:
diff changeset
1 // $HeadURL$
092188799a91 Incorrect code generation -O2 gdc
thomask
parents:
diff changeset
2 // $Date$
092188799a91 Incorrect code generation -O2 gdc
thomask
parents:
diff changeset
3 // $Author$
092188799a91 Incorrect code generation -O2 gdc
thomask
parents:
diff changeset
4
092188799a91 Incorrect code generation -O2 gdc
thomask
parents:
diff changeset
5 // @author@ Johan Granberg <lijat.meREM@OVEgmail.com>
092188799a91 Incorrect code generation -O2 gdc
thomask
parents:
diff changeset
6 // @date@ 2006-09-14
1488
1ee9a0dd42d9 changed nntp: URLs to http: URLs
thomask
parents: 1410
diff changeset
7 // @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=8389
1410
be2b20dc0eb4 added bugzilla URIs
thomask
parents: 1140
diff changeset
8 // @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1034
1140
092188799a91 Incorrect code generation -O2 gdc
thomask
parents:
diff changeset
9 // @desc@ Incorrect code generation -O2 gdc
092188799a91 Incorrect code generation -O2 gdc
thomask
parents:
diff changeset
10
092188799a91 Incorrect code generation -O2 gdc
thomask
parents:
diff changeset
11 module dstress.run.o.odd_bug_09_A;
092188799a91 Incorrect code generation -O2 gdc
thomask
parents:
diff changeset
12
092188799a91 Incorrect code generation -O2 gdc
thomask
parents:
diff changeset
13 struct S{
092188799a91 Incorrect code generation -O2 gdc
thomask
parents:
diff changeset
14 union{
092188799a91 Incorrect code generation -O2 gdc
thomask
parents:
diff changeset
15 void delegate(uint) del;
092188799a91 Incorrect code generation -O2 gdc
thomask
parents:
diff changeset
16 void function(uint) fp;
092188799a91 Incorrect code generation -O2 gdc
thomask
parents:
diff changeset
17 }
092188799a91 Incorrect code generation -O2 gdc
thomask
parents:
diff changeset
18 static S opCall(void function(uint) c,uint i){
092188799a91 Incorrect code generation -O2 gdc
thomask
parents:
diff changeset
19 S a;
092188799a91 Incorrect code generation -O2 gdc
thomask
parents:
diff changeset
20 a.fp = c;
092188799a91 Incorrect code generation -O2 gdc
thomask
parents:
diff changeset
21 return a;
092188799a91 Incorrect code generation -O2 gdc
thomask
parents:
diff changeset
22 }
092188799a91 Incorrect code generation -O2 gdc
thomask
parents:
diff changeset
23 }
092188799a91 Incorrect code generation -O2 gdc
thomask
parents:
diff changeset
24
092188799a91 Incorrect code generation -O2 gdc
thomask
parents:
diff changeset
25 S s;
092188799a91 Incorrect code generation -O2 gdc
thomask
parents:
diff changeset
26
092188799a91 Incorrect code generation -O2 gdc
thomask
parents:
diff changeset
27 static this(){
092188799a91 Incorrect code generation -O2 gdc
thomask
parents:
diff changeset
28 s = S(&foo, 0);
092188799a91 Incorrect code generation -O2 gdc
thomask
parents:
diff changeset
29 }
092188799a91 Incorrect code generation -O2 gdc
thomask
parents:
diff changeset
30
092188799a91 Incorrect code generation -O2 gdc
thomask
parents:
diff changeset
31 void foo(uint i){
092188799a91 Incorrect code generation -O2 gdc
thomask
parents:
diff changeset
32 }
092188799a91 Incorrect code generation -O2 gdc
thomask
parents:
diff changeset
33
092188799a91 Incorrect code generation -O2 gdc
thomask
parents:
diff changeset
34 int main(){
092188799a91 Incorrect code generation -O2 gdc
thomask
parents:
diff changeset
35 foo(0);
092188799a91 Incorrect code generation -O2 gdc
thomask
parents:
diff changeset
36 if(! s.fp){
092188799a91 Incorrect code generation -O2 gdc
thomask
parents:
diff changeset
37 assert(0);
092188799a91 Incorrect code generation -O2 gdc
thomask
parents:
diff changeset
38 }
092188799a91 Incorrect code generation -O2 gdc
thomask
parents:
diff changeset
39 s.fp(0);
092188799a91 Incorrect code generation -O2 gdc
thomask
parents:
diff changeset
40
092188799a91 Incorrect code generation -O2 gdc
thomask
parents:
diff changeset
41 return 0;
092188799a91 Incorrect code generation -O2 gdc
thomask
parents:
diff changeset
42 }
092188799a91 Incorrect code generation -O2 gdc
thomask
parents:
diff changeset
43