Mercurial > projects > dstress
annotate run/alias_04.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 |
rev | line source |
---|---|
374 | 1 // $HeadURL$ |
2 // $Date$ | |
3 // $Author$ | |
4 | |
5 module dstress.run.alias_04; | |
0 | 6 |
7 class A { | |
8 int foo(int a) { return 1; } | |
9 } | |
10 | |
11 class B : A { | |
12 int foo( int a, uint b ) { return 2; } | |
13 } | |
14 | |
15 class C : B { | |
16 int foo( int a ) { return 3; } | |
17 alias B.foo foo; | |
18 } | |
19 | |
20 class D : C { | |
21 } | |
22 | |
23 | |
24 int main(){ | |
25 D d = new D(); | |
26 | |
1559 | 27 if(d.foo(1, 2u) != 2){ |
28 assert(0); | |
29 } | |
30 if(d.foo(1) != 3){ | |
31 assert(0); | |
32 } | |
0 | 33 return 0; |
1 | 34 } |