Mercurial > projects > dstress
changeset 1118:6fa59f24470f
[Issue 305] version and static if blocks introduce new scope for 'scope' statement
Sean Kelly <sean@f4.ca>
2006-08-23
news:bug-305-3@http.d.puremagic.com/issues/
author | thomask |
---|---|
date | Fri, 25 Aug 2006 11:42:59 +0000 |
parents | 9393c8f2bc1e |
children | 72095373813d |
files | run/s/static_if_07_A.d run/s/static_if_07_B.d run/s/static_if_07_C.d run/s/static_if_07_D.d run/s/static_if_07_E.d run/v/version_38_A.d run/v/version_38_B.d run/v/version_38_C.d run/v/version_38_D.d run/v/version_38_E.d |
diffstat | 10 files changed, 324 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/s/static_if_07_A.d Fri Aug 25 11:42:59 2006 +0000 @@ -0,0 +1,31 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Sean Kelly <sean@f4.ca> +// @date@ 2006-08-23 +// @uri@ news:bug-305-3@http.d.puremagic.com/issues/ +// @desc@ [Issue 305] New: version and static if blocks introduce new scope for 'scope' statement + +module dstress.run.s.static_if_07_A; + +int status; + +void foo(){ + static if(true){ + scope(exit) status++; + } + static if(true){ + scope(exit) status *= 2; + } +} + +int main(){ + status = 1; + foo(); + if(status != 3){ + assert(0); + } + + return 0; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/s/static_if_07_B.d Fri Aug 25 11:42:59 2006 +0000 @@ -0,0 +1,31 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Sean Kelly <sean@f4.ca> +// @date@ 2006-08-23 +// @uri@ news:bug-305-3@http.d.puremagic.com/issues/ +// @desc@ [Issue 305] New: version and static if blocks introduce new scope for 'scope' statement + +module dstress.run.s.static_if_07_B; + +int status; + +void foo(){ + static if(true){ + scope(success) status++; + } + static if(true){ + scope(exit) status *= 2; + } +} + +int main(){ + status = 1; + foo(); + if(status != 3){ + assert(0); + } + + return 0; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/s/static_if_07_C.d Fri Aug 25 11:42:59 2006 +0000 @@ -0,0 +1,31 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Sean Kelly <sean@f4.ca> +// @date@ 2006-08-23 +// @uri@ news:bug-305-3@http.d.puremagic.com/issues/ +// @desc@ [Issue 305] New: version and static if blocks introduce new scope for 'scope' statement + +module dstress.run.s.static_if_07_C; + +int status; + +void foo(){ + static if(true){ + scope(success) status++; + } + static if(true){ + scope(success) status *= 2; + } +} + +int main(){ + status = 1; + foo(); + if(status != 3){ + assert(0); + } + + return 0; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/s/static_if_07_D.d Fri Aug 25 11:42:59 2006 +0000 @@ -0,0 +1,31 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Sean Kelly <sean@f4.ca> +// @date@ 2006-08-23 +// @uri@ news:bug-305-3@http.d.puremagic.com/issues/ +// @desc@ [Issue 305] New: version and static if blocks introduce new scope for 'scope' statement + +module dstress.run.s.static_if_07_D; + +int status; + +void foo(){ + static if(true){ + scope(exit) status++; + } + static if(true){ + scope(success) status *= 2; + } +} + +int main(){ + status = 1; + foo(); + if(status != 3){ + assert(0); + } + + return 0; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/s/static_if_07_E.d Fri Aug 25 11:42:59 2006 +0000 @@ -0,0 +1,38 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Sean Kelly <sean@f4.ca> +// @date@ 2006-08-23 +// @uri@ news:bug-305-3@http.d.puremagic.com/issues/ +// @desc@ [Issue 305] New: version and static if blocks introduce new scope for 'scope' statement + +module dstress.run.s.static_if_07_E; + +int status; + +void foo(){ + static if(true){ + scope(failure) status++; + } + static if(true){ + scope(failure) status *= 2; + } + + throw new Exception("message"); +} + +int main(){ + status = 1; + + try{ + foo(); + }catch{ + } + + if(status != 3){ + assert(0); + } + + return 0; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/v/version_38_A.d Fri Aug 25 11:42:59 2006 +0000 @@ -0,0 +1,31 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Sean Kelly <sean@f4.ca> +// @date@ 2006-08-23 +// @uri@ news:bug-305-3@http.d.puremagic.com/issues/ +// @desc@ [Issue 305] New: version and static if blocks introduce new scope for 'scope' statement + +module dstress.run.v.version_38_A; + +int status; + +void foo(){ + version( all ){ + scope(exit) status++; + } + version( all ){ + scope(exit) status *= 2; + } +} + +int main(){ + status = 1; + foo(); + if(status != 3){ + assert(0); + } + + return 0; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/v/version_38_B.d Fri Aug 25 11:42:59 2006 +0000 @@ -0,0 +1,31 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Sean Kelly <sean@f4.ca> +// @date@ 2006-08-23 +// @uri@ news:bug-305-3@http.d.puremagic.com/issues/ +// @desc@ [Issue 305] New: version and static if blocks introduce new scope for 'scope' statement + +module dstress.run.v.version_38_B; + +int status; + +void foo(){ + version( all ){ + scope(success) status++; + } + version( all ){ + scope(exit) status *= 2; + } +} + +int main(){ + status = 1; + foo(); + if(status != 3){ + assert(0); + } + + return 0; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/v/version_38_C.d Fri Aug 25 11:42:59 2006 +0000 @@ -0,0 +1,31 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Sean Kelly <sean@f4.ca> +// @date@ 2006-08-23 +// @uri@ news:bug-305-3@http.d.puremagic.com/issues/ +// @desc@ [Issue 305] New: version and static if blocks introduce new scope for 'scope' statement + +module dstress.run.v.version_38_C; + +int status; + +void foo(){ + version( all ){ + scope(success) status++; + } + version( all ){ + scope(success) status *= 2; + } +} + +int main(){ + status = 1; + foo(); + if(status != 3){ + assert(0); + } + + return 0; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/v/version_38_D.d Fri Aug 25 11:42:59 2006 +0000 @@ -0,0 +1,31 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Sean Kelly <sean@f4.ca> +// @date@ 2006-08-23 +// @uri@ news:bug-305-3@http.d.puremagic.com/issues/ +// @desc@ [Issue 305] New: version and static if blocks introduce new scope for 'scope' statement + +module dstress.run.v.version_38_D; + +int status; + +void foo(){ + version( all ){ + scope(exit) status++; + } + version( all ){ + scope(success) status *= 2; + } +} + +int main(){ + status = 1; + foo(); + if(status != 3){ + assert(0); + } + + return 0; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/v/version_38_E.d Fri Aug 25 11:42:59 2006 +0000 @@ -0,0 +1,38 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Sean Kelly <sean@f4.ca> +// @date@ 2006-08-23 +// @uri@ news:bug-305-3@http.d.puremagic.com/issues/ +// @desc@ [Issue 305] New: version and static if blocks introduce new scope for 'scope' statement + +module dstress.run.v.version_38_E; + +int status; + +void foo(){ + version( all ){ + scope(failure) status++; + } + version( all ){ + scope(failure) status *= 2; + } + + throw new Exception("message"); +} + +int main(){ + status = 1; + + try{ + foo(); + }catch{ + } + + if(status != 3){ + assert(0); + } + + return 0; +}