Mercurial > projects > dstress
changeset 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 | b50583aebed4 |
children | afe5f4bc8f9c |
files | run/f/finally_12_A.d |
diffstat | 1 files changed, 66 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/f/finally_12_A.d Sun Sep 30 09:48:22 2007 +0000 @@ -0,0 +1,66 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ <braddr@puremagic.com> +// @date@ 2007-09-17 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1513 +// @desc@ [Issue 1513] try/catch/finally misbehavior on windows + +module dstress.run.f.finally_12_A; + +int[] log; + +void check(){ + try{ + log ~= 1; + try{ + log ~= 2; + try{ + log ~= 3; + }finally{ + log ~= 4; + throw new Exception("ex 1"); + log ~= 5; + } + log ~= 6; + }catch(Exception e){ + log ~= 7; + if("ex 1" != e.toString()){ + assert(0); + } + }finally{ + log ~= 8; + throw new Exception("ex 2"); + log ~= 9; + } + log ~= 10; + }catch(Exception e){ + log ~= 11; + if("ex 2" != e.toString()){ + assert(0); + } + }finally{ + log ~= 12; + throw new Exception("ex 3"); + log ~= 13; + } + log ~= 14; +} + +int main(){ + try{ + log ~= 20; + check(); + log ~= 21; + }catch(Exception e){ + log ~= 22; + if("ex 3" != e.toString()){ + assert(0); + } + } + if([20,1,2,3,4,7,8,11,12,22] != log){ + assert(0); + } + return 0; +}