# HG changeset patch # User thomask # Date 1203607229 0 # Node ID 45e89f20882af7c07a2833333d083b8b867ec2e6 # Parent b3e16c86558e9a749684e482e6381e1a92052fe1 [Issue 1400] New: static array in struct as parameter BROKEN 2007-08-04 http://d.puremagic.com/issues/show_bug.cgi?id=1400 diff -r b3e16c86558e -r 45e89f20882a run/f/foreach_39_A.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/f/foreach_39_A.d Thu Feb 21 15:20:29 2008 +0000 @@ -0,0 +1,39 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ +// @date@ 2007-08-04 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1400 +// @desc@ [Issue 1400] New: static array in struct as parameter BROKEN + +module dstress.run.f.foreach_39_A; + +void test(float[3] t) { + if(5.0f != t[0]){ + assert(0); + } + if(6.0f != t[1]){ + assert(0); + } + if(7.0f != t[2]){ + assert(0); + } +} + +struct E { + float[3] data = [5.0f, 6.0f, 7.0f]; +} + +int main() { + E[] es; + E e; + + es~=e; + + foreach(inout v; es){ + test(v.data); + } + + return 0; +} diff -r b3e16c86558e -r 45e89f20882a run/f/foreach_39_B.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/f/foreach_39_B.d Thu Feb 21 15:20:29 2008 +0000 @@ -0,0 +1,39 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ +// @date@ 2007-08-04 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1400 +// @desc@ [Issue 1400] New: static array in struct as parameter BROKEN + +module dstress.run.f.foreach_39_B; + +void test(float[3] t) { + if(5.0f != t[0]){ + assert(0); + } + if(6.0f != t[1]){ + assert(0); + } + if(7.0f != t[2]){ + assert(0); + } +} + +struct E { + float[3] data = [5.0f, 6.0f, 7.0f]; +} + +int main() { + E[] es; + E e; + + es~=e; + + foreach(v; es){ + test(v.data); + } + + return 0; +} diff -r b3e16c86558e -r 45e89f20882a run/f/foreach_39_C.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/f/foreach_39_C.d Thu Feb 21 15:20:29 2008 +0000 @@ -0,0 +1,33 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ +// @date@ 2007-08-04 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1400 +// @desc@ [Issue 1400] New: static array in struct as parameter BROKEN + +module dstress.run.f.foreach_39_C; + +void test(float[3] t) { + if(5.0f != t[0]){ + assert(0); + } + if(6.0f != t[1]){ + assert(0); + } + if(7.0f != t[2]){ + assert(0); + } +} + +struct E { + float[3] data = [5.0f, 6.0f, 7.0f]; +} + +int main() { + E e; + test(e.data); + + return 0; +}