annotate norun/delete_04.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 9faddc0de2ba
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
379
60b4ba82210e added tests for custom deallocators
thomask
parents:
diff changeset
1 // $HeadURL$
60b4ba82210e added tests for custom deallocators
thomask
parents:
diff changeset
2 // $Date$
60b4ba82210e added tests for custom deallocators
thomask
parents:
diff changeset
3 // $Author$
60b4ba82210e added tests for custom deallocators
thomask
parents:
diff changeset
4
392
9faddc0de2ba 1) fixed meta data
thomask
parents: 379
diff changeset
5 // @WARNING@ direct access to Phobos's GC
9faddc0de2ba 1) fixed meta data
thomask
parents: 379
diff changeset
6
9faddc0de2ba 1) fixed meta data
thomask
parents: 379
diff changeset
7 // __DSTRESS_ELINE__ 15
379
60b4ba82210e added tests for custom deallocators
thomask
parents:
diff changeset
8
60b4ba82210e added tests for custom deallocators
thomask
parents:
diff changeset
9 module dstress.run.delete_04;
60b4ba82210e added tests for custom deallocators
thomask
parents:
diff changeset
10
392
9faddc0de2ba 1) fixed meta data
thomask
parents: 379
diff changeset
11 import std.gc;
9faddc0de2ba 1) fixed meta data
thomask
parents: 379
diff changeset
12
379
60b4ba82210e added tests for custom deallocators
thomask
parents:
diff changeset
13 class MyClass{
60b4ba82210e added tests for custom deallocators
thomask
parents:
diff changeset
14 delete(void* p){
60b4ba82210e added tests for custom deallocators
thomask
parents:
diff changeset
15 assert(0);
60b4ba82210e added tests for custom deallocators
thomask
parents:
diff changeset
16 }
60b4ba82210e added tests for custom deallocators
thomask
parents:
diff changeset
17 }
60b4ba82210e added tests for custom deallocators
thomask
parents:
diff changeset
18
392
9faddc0de2ba 1) fixed meta data
thomask
parents: 379
diff changeset
19 void test(){
9faddc0de2ba 1) fixed meta data
thomask
parents: 379
diff changeset
20 MyClass t = new MyClass();
9faddc0de2ba 1) fixed meta data
thomask
parents: 379
diff changeset
21 delete t;
9faddc0de2ba 1) fixed meta data
thomask
parents: 379
diff changeset
22 }
9faddc0de2ba 1) fixed meta data
thomask
parents: 379
diff changeset
23
379
60b4ba82210e added tests for custom deallocators
thomask
parents:
diff changeset
24 int main(){
392
9faddc0de2ba 1) fixed meta data
thomask
parents: 379
diff changeset
25 test();
9faddc0de2ba 1) fixed meta data
thomask
parents: 379
diff changeset
26 std.gc.fullCollect();
9faddc0de2ba 1) fixed meta data
thomask
parents: 379
diff changeset
27 std.gc.minimize();
379
60b4ba82210e added tests for custom deallocators
thomask
parents:
diff changeset
28 return 0;
60b4ba82210e added tests for custom deallocators
thomask
parents:
diff changeset
29 }