Mercurial > projects > dstress
annotate run/new_08.d @ 1576:b3e16c86558e
[Issue 1398] New: GDC doesn't generate correct code
<mariusmuja@gmail.com>
2007-08-04
http://d.puremagic.com/issues/show_bug.cgi?id=1398
author | thomask |
---|---|
date | Thu, 21 Feb 2008 15:20:08 +0000 |
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 } |