Mercurial > projects > dstress
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/goto_10.d Thu Dec 16 06:56:08 2004 +0000 @@ -0,0 +1,41 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +module dstress.run.goto_10; + +int status; + +int test(char[][] args){ + try{ + try{ + if(args.length==1){ + goto end; + } + }finally{ + assert(status==0); + status+=2; + } + + try{ + assert(0); + }finally{ + assert(0); + } + }finally{ + assert(status==2); + status+=3; + } + assert(0); + return 0; +end: + return -1; +} + +int main(char[][] args){ + assert(status == 0); + assert(args.length == 1); + assert(test(args) == -1); + assert(status == 5); + return 0; +}