annotate run/f/finally_12_A.d @ 1567:54833ea51c6f

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