Mercurial > projects > dstress
changeset 347:be3b6d528ac0
Stewart Gordon <smjg_1998@yahoo.com>
2005-03-21
news:d1mc4q$2peg$3@digitaldaemon.com
author | thomask |
---|---|
date | Tue, 22 Mar 2005 08:06:44 +0000 |
parents | 55d03895784e |
children | fbce9ada945b |
files | run/const_15.d run/const_16.d |
diffstat | 2 files changed, 48 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/const_15.d Tue Mar 22 08:06:44 2005 +0000 @@ -0,0 +1,24 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Stewart Gordon <smjg_1998@yahoo.com> +// @date@ 2005-03-21 +// @uri@ news:d1mc4q$2peg$3@digitaldaemon.com + +module dstress.run.const_15; + +struct StructA{ + int a; +} + +const int i = 15; + +const StructA s1 = { i+1 }; +const StructA s2 = { s1.a+1 }; + +int main(){ + assert(s1.a == 16); + assert(s2.a == 17); + return 0; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/const_16.d Tue Mar 22 08:06:44 2005 +0000 @@ -0,0 +1,24 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Stewart Gordon <smjg_1998@yahoo.com> +// @date@ 2005-03-21 +// @uri@ news:d1mc4q$2peg$3@digitaldaemon.com + +module dstress.run.const_16; + +struct StructA{ + int a; +} + +const int i = 15; + +const StructA s1 = { i+1 }; +const StructA s2 = { s1 }; + +int main(){ + assert(s1.a == 16); + assert(s2.a == 16); + return 0; +}