Mercurial > projects > dstress
changeset 1539:eb6a99028b95
[Issue 1262] Local variable of struct type initialized by literal resets when compared to .init
Frits van Bommel <fvbommel@wxs.nl>
2007-06-12
http://d.puremagic.com/issues/show_bug.cgi?id=1262
author | thomask |
---|---|
date | Sun, 01 Jul 2007 13:17:11 +0000 |
parents | 5530980c0d49 |
children | 94c9f2f9af4b |
files | run/i/init_06_A.d run/i/init_06_B.d run/i/init_06_C.d run/i/init_06_D.d |
diffstat | 4 files changed, 104 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/i/init_06_A.d Sun Jul 01 13:17:11 2007 +0000 @@ -0,0 +1,26 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Frits van Bommel <fvbommel@wxs.nl> +// @date@ 2007-06-12 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1262 +// @desc@ [Issue 1262] Local variable of struct type initialized by literal resets when compared to .init + +module dstress.run.i.init_06_A; + +struct S { + int x; +} + +int main() { + S s = S(10); + + if (s == s.init){ + assert(0); + }else if(10 != s.x){ + assert(0); + } + + return 0; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/i/init_06_B.d Sun Jul 01 13:17:11 2007 +0000 @@ -0,0 +1,26 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Frits van Bommel <fvbommel@wxs.nl> +// @date@ 2007-06-12 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1262 +// @desc@ [Issue 1262] Local variable of struct type initialized by literal resets when compared to .init + +module dstress.run.i.init_06_B; + +struct S { + int x; +} + +int main() { + S s = S(10); + + if (s == S.init){ + assert(0); + }else if(10 != s.x){ + assert(0); + } + + return 0; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/i/init_06_C.d Sun Jul 01 13:17:11 2007 +0000 @@ -0,0 +1,26 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Frits van Bommel <fvbommel@wxs.nl> +// @date@ 2007-06-12 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1262 +// @desc@ [Issue 1262] Local variable of struct type initialized by literal resets when compared to .init + +module dstress.run.i.init_06_C; + +struct S { + int x; +} + +S s = S(10); + +int main() { + if (s == S.init){ + assert(0); + }else if(10 != s.x){ + assert(0); + } + + return 0; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/i/init_06_D.d Sun Jul 01 13:17:11 2007 +0000 @@ -0,0 +1,26 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Frits van Bommel <fvbommel@wxs.nl> +// @date@ 2007-06-12 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1262 +// @desc@ [Issue 1262] Local variable of struct type initialized by literal resets when compared to .init + +module dstress.run.i.init_06_D; + +struct S { + int x; +} + +S s = S(10); + +int main() { + if (s == s.init){ + assert(0); + }else if(10 != s.x){ + assert(0); + } + + return 0; +}