Mercurial > projects > dstress
changeset 1152:0fb7b0fc000a
[Issue 381] New: array literals are broken; Internal error: ..\ztc\cod1.c 2525
Tomasz Stachowiak <h3r3tic@mat.uni.torun.pl>
2006-09-27
news:bug-381-3@http.d.puremagic.com/issues/
author | thomask |
---|---|
date | Fri, 29 Sep 2006 06:55:30 +0000 |
parents | 2a1a6610f7ad |
children | bd7f77817bf7 |
files | run/o/opCat_24_A.d run/o/opCat_24_B.d run/o/opCat_24_C.d run/o/opCat_24_D.d |
diffstat | 4 files changed, 121 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/o/opCat_24_A.d Fri Sep 29 06:55:30 2006 +0000 @@ -0,0 +1,26 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Tomasz Stachowiak <h3r3tic@mat.uni.torun.pl> +// @date@ 2006-09-27 +// @uri@ news:bug-381-3@http.d.puremagic.com/issues/ +// @desc@ [Issue 381] New: array literals are broken; Internal error: ..\ztc\cod1.c 2525 + +module dstress.run.o.opCat_24_A; + +void foo(int[] x) { + if(x.length != 2){ + assert(0); + } + if(x[0] != 1 || x[1] != 2){ + assert(0); + } +} + +int main(){ + foo([1] ~ 2); + + return 0; +} +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/o/opCat_24_B.d Fri Sep 29 06:55:30 2006 +0000 @@ -0,0 +1,35 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Tomasz Stachowiak <h3r3tic@mat.uni.torun.pl> +// @date@ 2006-09-27 +// @uri@ news:bug-381-3@http.d.puremagic.com/issues/ +// @desc@ [Issue 381] New: array literals are broken; Internal error: ..\ztc\cod1.c 2525 + +// __DSTRESS_WARNING__ direct access to Phobos's stdarg + +module dstress.run.o.opCat_24_B; +import std.stdarg; + +void foo(...) { + if(_arguments.length != 1){ + assert(0); + } + + int[] x = va_arg!(int[])(_argptr); + if(x.length != 2){ + assert(0); + } + if(x[0] != 1 || x[1] != 2){ + assert(0); + } +} + +int main(){ + const int[] a = [1, 2]; + foo(a); + + return 0; +} +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/o/opCat_24_C.d Fri Sep 29 06:55:30 2006 +0000 @@ -0,0 +1,35 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Tomasz Stachowiak <h3r3tic@mat.uni.torun.pl> +// @date@ 2006-09-27 +// @uri@ news:bug-381-3@http.d.puremagic.com/issues/ +// @desc@ [Issue 381] New: array literals are broken; Internal error: ..\ztc\cod1.c 2525 + +// __DSTRESS_WARNING__ direct access to Phobos's stdarg + +module dstress.run.o.opCat_24_C; +import std.stdarg; + +void foo(...) { + if(_arguments.length != 1){ + assert(0); + } + + int[] x = va_arg!(int[])(_argptr); + if(x.length != 2){ + assert(0); + } + if(x[0] != 1 || x[1] != 2){ + assert(0); + } +} + +int main(){ + const int[] a = [1, 2]; + foo([1] ~ 2); + + return 0; +} +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/o/opCat_24_D.d Fri Sep 29 06:55:30 2006 +0000 @@ -0,0 +1,25 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Tomasz Stachowiak <h3r3tic@mat.uni.torun.pl> +// @date@ 2006-09-27 +// @uri@ news:bug-381-3@http.d.puremagic.com/issues/ +// @desc@ [Issue 381] New: array literals are broken; Internal error: ..\ztc\cod1.c 2525 + +module dstress.run.o.opCat_24_D; + +int main(){ + int[] x; + x = [1] ~ 2; + + if(x.length != 2){ + assert(0); + } + if(x[0] != 1 || x[1] != 2){ + assert(0); + } + + return 0; +} +