Mercurial > projects > dstress
changeset 908:9755f3e63e3d
<regan@netwin.co.nz>
2006-03-12
news:bug-44-3@http.d.puremagic.com/bugzilla/
author | thomask |
---|---|
date | Mon, 13 Mar 2006 08:12:46 +0000 |
parents | f616cdfe7b96 |
children | 86b78b5ac267 |
files | run/u/union_16_A.d run/u/union_16_B.d run/u/union_16_C.d run/u/union_16_D.d run/u/union_16_E.d run/u/union_16_F.d run/u/union_16_G.d run/u/union_16_H.d |
diffstat | 8 files changed, 280 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/u/union_16_A.d Mon Mar 13 08:12:46 2006 +0000 @@ -0,0 +1,35 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ <regan@netwin.co.nz> +// @date@ 2006-03-12 +// @uri@ news:bug-44-3@http.d.puremagic.com/bugzilla/ + +module dstress.run.u.union_16_A; + +struct A { + int a; + union { + int c; + B b; + } + + new(size_t size){ + if(size != int.sizeof *3){ + assert(0); + } + return (new byte[size]).ptr; + } +} + +struct B { + int b1; + int b2; +} + +int main(){ + A* a = new A(); + + return 0; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/u/union_16_B.d Mon Mar 13 08:12:46 2006 +0000 @@ -0,0 +1,36 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ <regan@netwin.co.nz> +// @date@ 2006-03-12 +// @uri@ news:bug-44-3@http.d.puremagic.com/bugzilla/ + +module dstress.run.u.union_16_B; + +struct B { + int b1; + int b2; +} + +struct A { + int a; + union { + int c; + B b; + } + + new(size_t size){ + if(size != int.sizeof *3){ + assert(0); + } + return (new byte[size]).ptr; + } +} + + +int main(){ + A* a = new A(); + + return 0; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/u/union_16_C.d Mon Mar 13 08:12:46 2006 +0000 @@ -0,0 +1,33 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ <regan@netwin.co.nz> +// @date@ 2006-03-12 +// @uri@ news:bug-44-3@http.d.puremagic.com/bugzilla/ + +module dstress.run.u.union_16_C; + +struct B { + int b1; + int b2; +} + +struct A { + int a; + B b; + + new(size_t size){ + if(size != int.sizeof *3){ + assert(0); + } + return (new byte[size]).ptr; + } +} + + +int main(){ + A* a = new A(); + + return 0; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/u/union_16_D.d Mon Mar 13 08:12:46 2006 +0000 @@ -0,0 +1,33 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ <regan@netwin.co.nz> +// @date@ 2006-03-12 +// @uri@ news:bug-44-3@http.d.puremagic.com/bugzilla/ + +module dstress.run.u.union_16_D; + +struct A { + int a; + B b; + + new(size_t size){ + if(size != int.sizeof *3){ + assert(0); + } + return (new byte[size]).ptr; + } +} + +struct B { + int b1; + int b2; +} + + +int main(){ + A* a = new A(); + + return 0; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/u/union_16_E.d Mon Mar 13 08:12:46 2006 +0000 @@ -0,0 +1,35 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ <regan@netwin.co.nz> +// @date@ 2006-03-12 +// @uri@ news:bug-44-3@http.d.puremagic.com/bugzilla/ + +module dstress.run.u.union_16_E; + +struct A { + int a; + B b; +} + +struct B { + int b1; + int b2; +} + + +int main(){ + if(A.sizeof != int.sizeof * 3){ + assert(0); + } + + A a; + + if(a.sizeof != int.sizeof * 3){ + assert(0); + } + + + return 0; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/u/union_16_F.d Mon Mar 13 08:12:46 2006 +0000 @@ -0,0 +1,34 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ <regan@netwin.co.nz> +// @date@ 2006-03-12 +// @uri@ news:bug-44-3@http.d.puremagic.com/bugzilla/ + +module dstress.run.u.union_16_F; + +struct B { + int b1; + int b2; +} + +struct A { + int a; + B b; +} + +int main(){ + if(A.sizeof != int.sizeof * 3){ + assert(0); + } + + A a; + + if(a.sizeof != int.sizeof * 3){ + assert(0); + } + + + return 0; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/u/union_16_G.d Mon Mar 13 08:12:46 2006 +0000 @@ -0,0 +1,37 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ <regan@netwin.co.nz> +// @date@ 2006-03-12 +// @uri@ news:bug-44-3@http.d.puremagic.com/bugzilla/ + +module dstress.run.u.union_16_G; + +struct B { + int b1; + int b2; +} + +struct A { + int a; + union { + int c; + B b; + } +} + +int main(){ + if(A.sizeof != int.sizeof * 3){ + assert(0); + } + + A a; + + if(a.sizeof != int.sizeof * 3){ + assert(0); + } + + + return 0; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/u/union_16_H.d Mon Mar 13 08:12:46 2006 +0000 @@ -0,0 +1,37 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ <regan@netwin.co.nz> +// @date@ 2006-03-12 +// @uri@ news:bug-44-3@http.d.puremagic.com/bugzilla/ + +module dstress.run.u.union_16_H; + +struct A { + int a; + union { + int c; + B b; + } +} + +struct B { + int b1; + int b2; +} + +int main(){ + if(A.sizeof != int.sizeof * 3){ + assert(0); + } + + A a; + + if(a.sizeof != int.sizeof * 3){ + assert(0); + } + + + return 0; +}