Mercurial > projects > dstress
annotate run/overload_03.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 | f87ba6507260 |
children |
rev | line source |
---|---|
374 | 1 // $HeadURL$ |
2 // $Date$ | |
3 // $Author$ | |
4 | |
5 module dstress.run.overload_03; | |
0 | 6 |
7 int status; | |
8 | |
9 void check( byte b){ | |
10 status+=b; | |
11 } | |
12 | |
13 void check( short s ){ | |
14 status-=s; | |
15 } | |
16 | |
17 void check( int i ){ | |
18 status+= i*2; | |
19 } | |
20 | |
21 int main(){ | |
22 | |
23 byte b = 2; | |
24 short s = 3; | |
25 int i = 4; | |
26 | |
27 assert(status == 0); | |
28 check(b); | |
29 assert(status == 2); | |
30 check(s); | |
31 assert(status == -1); | |
32 check(i); | |
33 assert(status == 7 ); | |
34 return 0; | |
35 } | |
36 |