Mercurial > projects > dstress
annotate run/try_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 | f87ba6507260 |
children |
rev | line source |
---|---|
374 | 1 // $HeadURL$ |
2 // $Date$ | |
3 // $Author$ | |
4 | |
5 module dstress.run.try_04; | |
0 | 6 |
7 class MyException : Exception{ | |
8 this(char[] msg){ | |
9 super(msg); | |
10 } | |
11 int x; | |
12 } | |
13 int main(){ | |
14 int check=0; | |
15 assert(check==0); | |
16 try{ | |
17 MyException e=new MyException(""); | |
18 e.x=2; | |
19 throw e; | |
20 }catch(MyException me){ | |
21 assert(me.x==2); | |
22 check+=5; | |
23 }catch(Exception){ | |
24 check+=3; | |
25 }finally{ | |
26 check++; | |
27 } | |
28 assert(check==6); | |
29 return 0; | |
30 } |