comparison run/goto_10.d @ 203:85ed61918ae4

added "intervening finally" tests for break and goto
author thomask
date Thu, 16 Dec 2004 06:56:08 +0000
parents
children
comparison
equal deleted inserted replaced
202:4cd33115f015 203:85ed61918ae4
1 // $HeadURL$
2 // $Date$
3 // $Author$
4
5 module dstress.run.goto_10;
6
7 int status;
8
9 int test(char[][] args){
10 try{
11 try{
12 if(args.length==1){
13 goto end;
14 }
15 }finally{
16 assert(status==0);
17 status+=2;
18 }
19
20 try{
21 assert(0);
22 }finally{
23 assert(0);
24 }
25 }finally{
26 assert(status==2);
27 status+=3;
28 }
29 assert(0);
30 return 0;
31 end:
32 return -1;
33 }
34
35 int main(char[][] args){
36 assert(status == 0);
37 assert(args.length == 1);
38 assert(test(args) == -1);
39 assert(status == 5);
40 return 0;
41 }