annotate run/destructor_04.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 b8c0195059d9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
269
281520e4cf9e dtor called after exception in thrown in the ctor
thomask
parents:
diff changeset
1 // $HeadURL$
281520e4cf9e dtor called after exception in thrown in the ctor
thomask
parents:
diff changeset
2 // $Date$
281520e4cf9e dtor called after exception in thrown in the ctor
thomask
parents:
diff changeset
3 // $Author$
281520e4cf9e dtor called after exception in thrown in the ctor
thomask
parents:
diff changeset
4
281520e4cf9e dtor called after exception in thrown in the ctor
thomask
parents:
diff changeset
5 // @author@ Kevin Bealer <Kevin_member@pathlink.com>
281520e4cf9e dtor called after exception in thrown in the ctor
thomask
parents:
diff changeset
6 // @date@ 2005-02-05
1489
b8c0195059d9 changed nntp: URLs to http: URLs
thomask
parents: 800
diff changeset
7 // @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=2864
269
281520e4cf9e dtor called after exception in thrown in the ctor
thomask
parents:
diff changeset
8
281520e4cf9e dtor called after exception in thrown in the ctor
thomask
parents:
diff changeset
9 module dstress.run.destructor_04;
281520e4cf9e dtor called after exception in thrown in the ctor
thomask
parents:
diff changeset
10
800
6662d67963c0 Sean Kelly <sean@f4.ca>
thomask
parents: 756
diff changeset
11 bool hadDtor = false;
6662d67963c0 Sean Kelly <sean@f4.ca>
thomask
parents: 756
diff changeset
12
269
281520e4cf9e dtor called after exception in thrown in the ctor
thomask
parents:
diff changeset
13 class MyClass{
281520e4cf9e dtor called after exception in thrown in the ctor
thomask
parents:
diff changeset
14 this(){
281520e4cf9e dtor called after exception in thrown in the ctor
thomask
parents:
diff changeset
15 throw new Exception("dummy");
281520e4cf9e dtor called after exception in thrown in the ctor
thomask
parents:
diff changeset
16 }
281520e4cf9e dtor called after exception in thrown in the ctor
thomask
parents:
diff changeset
17
281520e4cf9e dtor called after exception in thrown in the ctor
thomask
parents:
diff changeset
18 ~this(){
800
6662d67963c0 Sean Kelly <sean@f4.ca>
thomask
parents: 756
diff changeset
19 hadDtor = true;
756
9a121126b077 major "Torture" review
thomask
parents: 269
diff changeset
20 throw new Exception("should never throw");
800
6662d67963c0 Sean Kelly <sean@f4.ca>
thomask
parents: 756
diff changeset
21
269
281520e4cf9e dtor called after exception in thrown in the ctor
thomask
parents:
diff changeset
22 }
281520e4cf9e dtor called after exception in thrown in the ctor
thomask
parents:
diff changeset
23 }
281520e4cf9e dtor called after exception in thrown in the ctor
thomask
parents:
diff changeset
24
281520e4cf9e dtor called after exception in thrown in the ctor
thomask
parents:
diff changeset
25 int main(){
281520e4cf9e dtor called after exception in thrown in the ctor
thomask
parents:
diff changeset
26 MyClass c;
281520e4cf9e dtor called after exception in thrown in the ctor
thomask
parents:
diff changeset
27
281520e4cf9e dtor called after exception in thrown in the ctor
thomask
parents:
diff changeset
28 try{
281520e4cf9e dtor called after exception in thrown in the ctor
thomask
parents:
diff changeset
29 c = new MyClass();
281520e4cf9e dtor called after exception in thrown in the ctor
thomask
parents:
diff changeset
30 }catch{
800
6662d67963c0 Sean Kelly <sean@f4.ca>
thomask
parents: 756
diff changeset
31 if(!hadDtor){
6662d67963c0 Sean Kelly <sean@f4.ca>
thomask
parents: 756
diff changeset
32 return 0;
6662d67963c0 Sean Kelly <sean@f4.ca>
thomask
parents: 756
diff changeset
33 }else{
6662d67963c0 Sean Kelly <sean@f4.ca>
thomask
parents: 756
diff changeset
34 assert(0);
6662d67963c0 Sean Kelly <sean@f4.ca>
thomask
parents: 756
diff changeset
35 }
269
281520e4cf9e dtor called after exception in thrown in the ctor
thomask
parents:
diff changeset
36 }
281520e4cf9e dtor called after exception in thrown in the ctor
thomask
parents:
diff changeset
37
800
6662d67963c0 Sean Kelly <sean@f4.ca>
thomask
parents: 756
diff changeset
38 assert(0);
269
281520e4cf9e dtor called after exception in thrown in the ctor
thomask
parents:
diff changeset
39 }