834
|
1 // $HeadURL$
|
|
2 // $Date$
|
|
3 // $Author$
|
|
4
|
|
5 // @author@ Nick <Nick_member@pathlink.com>
|
|
6 // @date@ 2006-02-15
|
1489
|
7 // @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=6267
|
834
|
8
|
|
9 module dstress.run.d.delete_12_D;
|
|
10
|
|
11 int status;
|
|
12
|
|
13 class Foo{
|
|
14 int i;
|
|
15
|
|
16 new(size_t sz){
|
|
17 void* p;
|
|
18
|
889
|
19 p = (new byte[sz]).ptr;
|
1091
|
20
|
834
|
21 if(status++ != 1){
|
|
22 assert(0);
|
|
23 }
|
|
24
|
|
25 return p;
|
|
26 }
|
|
27
|
|
28 delete(void* p){
|
|
29 if(status++ != 2){
|
|
30 assert(0);
|
|
31 }
|
|
32 }
|
|
33 }
|
|
34
|
|
35 void test(){
|
|
36 auto Foo f = new Foo();
|
|
37 delete f;
|
|
38 }
|
|
39
|
|
40 int main(){
|
|
41 if(status++ != 0){
|
|
42 assert(0);
|
|
43 }
|
|
44
|
|
45 test();
|
|
46
|
|
47 if(status++ != 3){
|
|
48 assert(0);
|
|
49 }
|
|
50
|
|
51 return 0;
|
|
52 }
|