# HG changeset patch # User thomask # Date 1119460546 0 # Node ID 6ee3b4b671c1457544bacb126fbb5671df59b444 # Parent 0a5d755db2c40f19f6da8d31a5344f57121cd4c5 forach and throw/catch code generation Nick 2005-06-21 news:d99id2$fgj$1@digitaldaemon.com diff -r 0a5d755db2c4 -r 6ee3b4b671c1 run/c/catch_05_A.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/c/catch_05_A.d Wed Jun 22 17:15:46 2005 +0000 @@ -0,0 +1,38 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Nick +// @date@ 2005-06-21 +// @uri@ news:d99id2$fgj$1@digitaldaemon.com +// @desc@ foreach and throw/catch code generation + +module dstress.run.c.catch_05_A; + +void dummy(){ +} + +int bb[char[]]; + +int main(){ + + foreach(char[] s, int i; bb){ + dummy(); + } + + bb["a"] = 1; + + foreach(int b; bb){ + try{ + throw new Error("foo"); + }catch(Error e){ + assert(e); + return 0; + }catch{ + assert(0); + } + assert(0); + } + + assert(0); +} diff -r 0a5d755db2c4 -r 6ee3b4b671c1 run/c/catch_05_B.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/c/catch_05_B.d Wed Jun 22 17:15:46 2005 +0000 @@ -0,0 +1,38 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Nick +// @date@ 2005-06-21 +// @uri@ news:d99id2$fgj$1@digitaldaemon.com +// @desc@ foreach and throw/catch code generation + +module dstress.run.c.catch_05_B; + +void dummy(...){ +} + +int bb[char[]]; + +int main(){ + + foreach(char[] s, int i; bb){ + dummy(); + } + + bb["a"] = 1; + + foreach(int b; bb){ + try{ + throw new Error("foo"); + }catch(Error e){ + assert(e); + return 0; + }catch{ + assert(0); + } + assert(0); + } + + assert(0); +} diff -r 0a5d755db2c4 -r 6ee3b4b671c1 run/c/catch_05_C.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/c/catch_05_C.d Wed Jun 22 17:15:46 2005 +0000 @@ -0,0 +1,48 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Nick +// @date@ 2005-06-21 +// @uri@ news:d99id2$fgj$1@digitaldaemon.com +// @desc@ foreach and throw/catch code generation + +module dstress.run.c.catch_05_C; + +int counter; + +void dummy(){ + counter++; +} + +int bb[char[]]; + +int main(){ + + bb["zwei"] = 2; + + assert(counter==0); + + foreach(char[] s, int i; bb){ + dummy(); + } + + assert(counter==1); + + bb["a"] = 1; + + foreach(int b; bb){ + try{ + throw new Error("foo"); + }catch(Error e){ + assert(e); + assert(counter==1); + return 0; + }catch{ + assert(0); + } + assert(0); + } + + assert(0); +} diff -r 0a5d755db2c4 -r 6ee3b4b671c1 run/c/catch_05_D.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/c/catch_05_D.d Wed Jun 22 17:15:46 2005 +0000 @@ -0,0 +1,48 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Nick +// @date@ 2005-06-21 +// @uri@ news:d99id2$fgj$1@digitaldaemon.com +// @desc@ foreach and throw/catch code generation + +module dstress.run.c.catch_05_D; + +int counter; + +void dummy(){ + counter++; +} + +int bb[char[]]; + +int main(){ + + bb["zwei"] = 2; + + assert(counter==0); + + foreach(int i; bb){ + dummy(); + } + + assert(counter==1); + + bb["a"] = 1; + + foreach(int b; bb){ + try{ + throw new Error("foo"); + }catch(Error e){ + assert(e); + assert(counter==1); + return 0; + }catch{ + assert(0); + } + assert(0); + } + + assert(0); +} diff -r 0a5d755db2c4 -r 6ee3b4b671c1 run/c/catch_05_E.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/c/catch_05_E.d Wed Jun 22 17:15:46 2005 +0000 @@ -0,0 +1,46 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Nick +// @date@ 2005-06-21 +// @uri@ news:d99id2$fgj$1@digitaldaemon.com +// @desc@ foreach and throw/catch code generation + +module dstress.run.c.catch_05_E; + +int counter; + +void dummy(){ + counter++; +} + +int bb[char[]]; + +int main(){ + + assert(counter==0); + + foreach(int i; bb){ + dummy(); + } + + assert(counter==0); + + bb["a"] = 1; + + foreach(int b; bb){ + try{ + throw new Error("foo"); + }catch(Error e){ + assert(e); + assert(counter==0); + return 0; + }catch{ + assert(0); + } + assert(0); + } + + assert(0); +} diff -r 0a5d755db2c4 -r 6ee3b4b671c1 run/c/catch_05_F.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/c/catch_05_F.d Wed Jun 22 17:15:46 2005 +0000 @@ -0,0 +1,46 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Nick +// @date@ 2005-06-21 +// @uri@ news:d99id2$fgj$1@digitaldaemon.com +// @desc@ foreach and throw/catch code generation + +module dstress.run.c.catch_05_F; + +int counter; + +void dummy(...){ + counter++; +} + +int bb[char[]]; + +int main(){ + + assert(counter==0); + + foreach(int i; bb){ + dummy(...); + } + + assert(counter==0); + + bb["a"] = 1; + + foreach(int b; bb){ + try{ + throw new Error("foo"); + }catch(Error e){ + assert(e); + assert(counter==0); + return 0; + }catch{ + assert(0); + } + assert(0); + } + + assert(0); +} diff -r 0a5d755db2c4 -r 6ee3b4b671c1 run/c/catch_05_G.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/c/catch_05_G.d Wed Jun 22 17:15:46 2005 +0000 @@ -0,0 +1,31 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Nick +// @date@ 2005-06-21 +// @uri@ news:d99id2$fgj$1@digitaldaemon.com +// @desc@ foreach and throw/catch code generation + +module dstress.run.c.catch_05_G; + +int bb[char[]]; + +int main(){ + + bb["a"] = 1; + + foreach(int b; bb){ + try{ + throw new Error("foo"); + }catch(Error e){ + assert(e); + return 0; + }catch{ + assert(0); + } + assert(0); + } + + assert(0); +}