Mercurial > projects > dstress
annotate run/d/delegate_17_A.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 | 81222734adf3 |
children |
rev | line source |
---|---|
1036 | 1 // $HeadURL$ |
2 // $Date$ | |
3 // $Author$ | |
4 | |
5 // @author@ <sky@quit-clan.de> | |
6 // @date@ 2006-05-24 | |
1319
81222734adf3
sed'ed replacement of new:...http.d.puremagic.co... with http://d.puremagic.com/issues/show_bug.cgi?...
thomask
parents:
1091
diff
changeset
|
7 // @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=155 |
1036 | 8 |
9 module dstress.run.d.delegate_17_A; | |
10 | |
11 int status; | |
12 | |
13 class Foo{ | |
14 class Bar{ | |
15 int delegate() getDelegate(){ | |
16 return &sayHello; | |
17 } | |
18 } | |
19 Bar bar; | |
20 | |
21 int sayHello(){ | |
22 return ++status; | |
23 } | |
24 | |
25 this(){ | |
26 bar = new Bar(); | |
27 } | |
28 } | |
29 | |
30 int main(){ | |
31 Foo foo = new Foo(); | |
32 int delegate() hallo; | |
1091 | 33 |
1036 | 34 hallo = foo.bar.getDelegate(); |
35 | |
36 if(!hallo){ | |
37 assert(0); | |
38 } | |
39 if(status != 0){ | |
40 assert(0); | |
41 } | |
42 if(hallo() != 1){ | |
43 assert(0); | |
44 } | |
45 if(status != 1){ | |
46 assert(0); | |
47 } | |
1091 | 48 |
1036 | 49 return 0; |
50 } | |
51 |