1567
|
1 // $HeadURL$
|
|
2 // $Date$
|
|
3 // $Author$
|
|
4
|
|
5 // @author@ <braddr@puremagic.com>
|
|
6 // @date@ 2007-09-17
|
|
7 // @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1513
|
|
8 // @desc@ [Issue 1513] try/catch/finally misbehavior on windows
|
|
9
|
|
10 module dstress.run.f.finally_12_A;
|
|
11
|
|
12 int[] log;
|
|
13
|
|
14 void check(){
|
|
15 try{
|
|
16 log ~= 1;
|
|
17 try{
|
|
18 log ~= 2;
|
|
19 try{
|
|
20 log ~= 3;
|
|
21 }finally{
|
|
22 log ~= 4;
|
|
23 throw new Exception("ex 1");
|
|
24 log ~= 5;
|
|
25 }
|
|
26 log ~= 6;
|
|
27 }catch(Exception e){
|
|
28 log ~= 7;
|
|
29 if("ex 1" != e.toString()){
|
|
30 assert(0);
|
|
31 }
|
|
32 }finally{
|
|
33 log ~= 8;
|
|
34 throw new Exception("ex 2");
|
|
35 log ~= 9;
|
|
36 }
|
|
37 log ~= 10;
|
|
38 }catch(Exception e){
|
|
39 log ~= 11;
|
|
40 if("ex 2" != e.toString()){
|
|
41 assert(0);
|
|
42 }
|
|
43 }finally{
|
|
44 log ~= 12;
|
|
45 throw new Exception("ex 3");
|
|
46 log ~= 13;
|
|
47 }
|
|
48 log ~= 14;
|
|
49 }
|
|
50
|
|
51 int main(){
|
|
52 try{
|
|
53 log ~= 20;
|
|
54 check();
|
|
55 log ~= 21;
|
|
56 }catch(Exception e){
|
|
57 log ~= 22;
|
|
58 if("ex 3" != e.toString()){
|
|
59 assert(0);
|
|
60 }
|
|
61 }
|
|
62 if([20,1,2,3,4,7,8,11,12,22] != log){
|
|
63 assert(0);
|
|
64 }
|
|
65 return 0;
|
|
66 }
|