annotate run/finally_01.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 6e4063f99377
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
143
8784e1a831b8 error handling within "finally"
thomask
parents:
diff changeset
1 // $HeadURL$
8784e1a831b8 error handling within "finally"
thomask
parents:
diff changeset
2 // $Date$
8784e1a831b8 error handling within "finally"
thomask
parents:
diff changeset
3 // $Author$
8784e1a831b8 error handling within "finally"
thomask
parents:
diff changeset
4
8784e1a831b8 error handling within "finally"
thomask
parents:
diff changeset
5 // @author@ Sean Kelly <sean@f4.ca>
8784e1a831b8 error handling within "finally"
thomask
parents:
diff changeset
6 // @date 2004-11-16
8784e1a831b8 error handling within "finally"
thomask
parents:
diff changeset
7 // @uri@ news:cndnk4$17ld$1@digitaldaemon.com
1487
6e4063f99377 changed nntp: URLs to http: URLs
thomask
parents: 1383
diff changeset
8 // @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=2283
240
7aa29e681c0a bulk offline update
thomask
parents: 143
diff changeset
9
7aa29e681c0a bulk offline update
thomask
parents: 143
diff changeset
10 module dstress.run.finally_01;
7aa29e681c0a bulk offline update
thomask
parents: 143
diff changeset
11
143
8784e1a831b8 error handling within "finally"
thomask
parents:
diff changeset
12 int main(){
8784e1a831b8 error handling within "finally"
thomask
parents:
diff changeset
13 int status=0;
8784e1a831b8 error handling within "finally"
thomask
parents:
diff changeset
14 try{
8784e1a831b8 error handling within "finally"
thomask
parents:
diff changeset
15 try{
8784e1a831b8 error handling within "finally"
thomask
parents:
diff changeset
16 status++;
8784e1a831b8 error handling within "finally"
thomask
parents:
diff changeset
17 assert(status==1);
8784e1a831b8 error handling within "finally"
thomask
parents:
diff changeset
18 throw new Exception("first");
8784e1a831b8 error handling within "finally"
thomask
parents:
diff changeset
19 }finally{
8784e1a831b8 error handling within "finally"
thomask
parents:
diff changeset
20 status++;
8784e1a831b8 error handling within "finally"
thomask
parents:
diff changeset
21 assert(status==2);
8784e1a831b8 error handling within "finally"
thomask
parents:
diff changeset
22 status++;
8784e1a831b8 error handling within "finally"
thomask
parents:
diff changeset
23 throw new Exception("second");
8784e1a831b8 error handling within "finally"
thomask
parents:
diff changeset
24 }
8784e1a831b8 error handling within "finally"
thomask
parents:
diff changeset
25 }catch(Exception e){
8784e1a831b8 error handling within "finally"
thomask
parents:
diff changeset
26 assert(status==3);
8784e1a831b8 error handling within "finally"
thomask
parents:
diff changeset
27 }
8784e1a831b8 error handling within "finally"
thomask
parents:
diff changeset
28 return 0;
8784e1a831b8 error handling within "finally"
thomask
parents:
diff changeset
29 }