Mercurial > projects > dstress
changeset 1452:a3141f24cfac
[Issue 1072] this code should run as the same as previous bug code , but dmd av here
david <davidl@126.com>
2007-03-20
http://d.puremagic.com/issues/show_bug.cgi?id=1072
author | thomask |
---|---|
date | Wed, 04 Apr 2007 20:34:23 +0000 |
parents | 623963e374c5 |
children | 684421d327df |
files | compile/a/array_initialization_33_A.d compile/a/array_initialization_33_B.d compile/a/array_initialization_33_C.d compile/a/array_initialization_33_D.d compile/a/array_initialization_33_E.d |
diffstat | 5 files changed, 97 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compile/a/array_initialization_33_A.d Wed Apr 04 20:34:23 2007 +0000 @@ -0,0 +1,20 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ david <davidl@126.com> +// @date@ 2007-03-20 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1072 +// @desc@ [Issue 1072] this code should run as the same as previous bug code , but dmd av here + +module dstress.compile.a.array_initialization_33_A; + +char[] hello(){ + char[] result=""; + for(;;){ + result ~= `abc`; + } + return result; +} + +static assert("" == hello());
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compile/a/array_initialization_33_B.d Wed Apr 04 20:34:23 2007 +0000 @@ -0,0 +1,20 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ david <davidl@126.com> +// @date@ 2007-03-20 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1072 +// @desc@ [Issue 1072] this code should run as the same as previous bug code , but dmd av here + +module dstress.compile.a.array_initialization_33_B; + +char[] hello(){ + char[] result=""; + foreach(c; ""){ + result ~= `abc`; + } + return result; +} + +static assert("" == hello());
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compile/a/array_initialization_33_C.d Wed Apr 04 20:34:23 2007 +0000 @@ -0,0 +1,20 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ david <davidl@126.com> +// @date@ 2007-03-20 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1072 +// @desc@ [Issue 1072] this code should run as the same as previous bug code , but dmd av here + +module dstress.compile.a.array_initialization_33_C; + +char[] hello(){ + char[] result=""; + while(false){ + result ~= `abc`; + } + return result; +} + +static assert("" == hello());
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compile/a/array_initialization_33_D.d Wed Apr 04 20:34:23 2007 +0000 @@ -0,0 +1,17 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ david <davidl@126.com> +// @date@ 2007-03-20 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1072 +// @desc@ [Issue 1072] this code should run as the same as previous bug code , but dmd av here + +module dstress.compile.a.array_initialization_33_D; + +char[] hello(){ + char[] result=""; + return result; +} + +static assert("" == hello());
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compile/a/array_initialization_33_E.d Wed Apr 04 20:34:23 2007 +0000 @@ -0,0 +1,20 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ david <davidl@126.com> +// @date@ 2007-03-20 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1072 +// @desc@ [Issue 1072] this code should run as the same as previous bug code , but dmd av here + +module dstress.compile.a.array_initialization_33_E; + +char[] hello(bool do_loop){ + char[] result=""; + for(;do_loop;){ + result ~= `abc`; + } + return result; +} + +static assert("" == hello(false));