annotate run/overload_15.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 b8c0195059d9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
259
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
1 // $HeadURL$
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
2 // $Date$
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
3 // $Author$
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
4
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
5 // @author@ Nick Sabalausky <z@a.a>
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
6 // @date@ 2005-02-01
1489
b8c0195059d9 changed nntp: URLs to http: URLs
thomask
parents: 1383
diff changeset
7 // @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=2825
1383
52c9e86b6486 @url@ -> @uri@
thomask
parents: 259
diff changeset
8 // @uri@ nntp://news.digitmars.com/digitalmars.D.bugs
259
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
9
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
10 module dstress.run.overload_15;
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
11
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
12 int status;
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
13
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
14 void check(int x){
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
15 status++;
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
16 }
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
17
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
18 class MyClass{
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
19 void test(){
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
20 assert(status==0);
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
21 .check(0);
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
22 assert(status==1);
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
23 check();
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
24 assert(status==3);
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
25 }
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
26
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
27 void check(){
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
28 assert(status==1);
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
29 status+=2;
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
30 }
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
31 }
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
32
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
33 int main(){
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
34 MyClass c = new MyClass();
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
35 assert(status==0);
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
36 c.test();
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
37 assert(status==3);
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
38 check(0);
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
39 assert(status==4);
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
40 return 0;
55f5fa58d38e function overloading / resolving
thomask
parents:
diff changeset
41 }