Mercurial > projects > dstress
annotate run/new_08.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 | b3da1b510a19 |
children |
rev | line source |
---|---|
378 | 1 // $HeadURL$ |
2 // $Date$ | |
3 // $Author$ | |
4 | |
5 module dstress.run.new_08; | |
6 | |
7 int counter; | |
8 int counter2; | |
9 | |
10 class Parent{ | |
11 new(size_t size){ | |
12 counter++; | |
889 | 13 return (new byte[size]).ptr; |
378 | 14 } |
15 } | |
16 | |
17 class Child : Parent{ | |
18 new(size_t size){ | |
19 counter2++; | |
889 | 20 return (new byte[size]).ptr; |
378 | 21 } |
22 } | |
23 | |
24 int main(){ | |
25 assert(counter==0); | |
26 assert(counter2==0); | |
27 Child c = new Child(); | |
28 assert(counter==0); | |
29 assert(counter2==1); | |
30 return 0; | |
31 } |