Mercurial > projects > dstress
changeset 186:c18d6e8a712e
extended goto tests
author | thomask |
---|---|
date | Thu, 09 Dec 2004 06:54:59 +0000 |
parents | 6067056cad0c |
children | 3c8211ff9a83 |
files | run/goto_07.d run/goto_08.d run/goto_09.d |
diffstat | 3 files changed, 53 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/goto_07.d Thu Dec 09 06:54:59 2004 +0000 @@ -0,0 +1,20 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +module dstress.run.goto_07; + +int main(){ + + int label=1; + if(0){ +label: + int label=2; + assert(label==2); + }else{ + assert(label==1); + goto label; + } + assert(label==1); + return 0; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/goto_08.d Thu Dec 09 06:54:59 2004 +0000 @@ -0,0 +1,18 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +module dstress.run.goto_08; + +int main(char[][] arg){ + + assert(arg.length==1); + + if(arg.length!=1){ +label: + return 0; + }else{ + goto label; + } + assert(0); +}