Mercurial > projects > dstress
annotate run/function_02.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 | c848807fdfcb |
children |
rev | line source |
---|---|
418 | 1 // $HeadURL$ |
2 // $Date$ | |
3 // $Author$ | |
4 | |
5 // @author@ Benjamin Herr | |
6 // @date@ 2005-04-09 | |
7 | |
8 module dstress.run.function_02; | |
9 | |
10 int status; | |
11 | |
12 class Foo { | |
13 this(int i) { | |
14 this.i = i; | |
15 } | |
16 | |
17 void f() { | |
18 assert(i==123); | |
19 status++; | |
20 } | |
21 | |
22 int i; | |
23 } | |
24 | |
25 int main() { | |
26 void function(Foo f) fg = cast(void function(Foo f)) &Foo.f; | |
27 | |
28 assert(status==0); | |
29 fg(new Foo(123)); | |
30 assert(status==1); | |
31 | |
32 return 0; | |
33 } |