annotate run/bug_20050128_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 ec5e144583ea
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
256
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
1 // $HeadURL$
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
2 // $Date$
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
3 // $Author$
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
4
564
e77e4444c170 partial metadata fix
thomask
parents: 256
diff changeset
5 // @author@ Nick <Nick_member@pathlink.com>
256
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
6 // @date@ 2005-01-28
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
7 // @uri@ news:ctdtgj$30r$1@digitaldaemon.com
1384
d3a3e0c251d8 nntp: -> http:
thomask
parents: 1383
diff changeset
8 // @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=2784
256
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
9
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
10 module dstress.run.bug_20050128_B;
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
11
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
12 struct MyStruct{
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
13 int i;
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
14
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
15 void display(){
1559
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 1384
diff changeset
16 if(10 != i){
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 1384
diff changeset
17 assert(0);
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 1384
diff changeset
18 }
256
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
19 }
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
20
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
21 void someFunc(){
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
22 // We never call this function
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
23 void bug(MyStruct[] array){
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
24 // array[0].i = i+1; // Comment out this line and the bug goes away
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
25 }
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
26
1559
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 1384
diff changeset
27 if(10 != i){
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 1384
diff changeset
28 assert(0);
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 1384
diff changeset
29 }
256
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
30 display();
1559
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 1384
diff changeset
31 if(10 != i){
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 1384
diff changeset
32 assert(0);
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 1384
diff changeset
33 }
256
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
34 }
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
35 }
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
36
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
37 int main(){
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
38 MyStruct m;
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
39 m.i = 10;
1559
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 1384
diff changeset
40 if(10 != m.i){
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 1384
diff changeset
41 assert(0);
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 1384
diff changeset
42 }
256
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
43 m.someFunc();
1559
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 1384
diff changeset
44 if(10 != m.i){
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 1384
diff changeset
45 assert(0);
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 1384
diff changeset
46 }
256
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
47 return 0;
564
e77e4444c170 partial metadata fix
thomask
parents: 256
diff changeset
48 }