# HG changeset patch # User thomask # Date 1119600080 0 # Node ID 8c65d48f3d79b840e5a47b11cc27de695808f87b # Parent 1f473003ec30920e4114e915fc0e895bd0b39952 inline / opMul /with Victor Nakoryakov 2005-06-25 news:d9e3af$1olf$1@digitaldaemon.com diff -r 1f473003ec30 -r 8c65d48f3d79 run/i/inline_11_A.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/i/inline_11_A.d Fri Jun 24 08:01:20 2005 +0000 @@ -0,0 +1,41 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Victor Nakoryakov +// @date@ 2005-06-25 +// @uri@ news:d9e3af$1olf$1@digitaldaemon.com + +module dstress.run.i.inline_11_A; + +struct Struct{ + int i; + + Struct foo(){ + Struct s; + int a = i; + int b = s.i; + with (s) { + i+=2; + } + assert(a==i); + assert(b+2==s.i); + return s; + } + + Struct bar(){ + return Struct.foo() * Struct.foo(); + } + + Struct opMul(Struct s){ + Struct ss; + ss.i = s.i * i; + return ss; + } +} + +int main(){ + Struct s; + assert(s.bar().i==4); + return 0; +} diff -r 1f473003ec30 -r 8c65d48f3d79 run/i/inline_11_B.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/i/inline_11_B.d Fri Jun 24 08:01:20 2005 +0000 @@ -0,0 +1,43 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Victor Nakoryakov +// @date@ 2005-06-25 +// @uri@ news:d9e3af$1olf$1@digitaldaemon.com + +// __DSTRESS_DFLAGS__ -inline + +module dstress.run.i.inline_11_B; + +struct Struct{ + int i; + + Struct foo(){ + Struct s; + int a = i; + int b = s.i; + with (s) { + i+=2; + } + assert(a==i); + assert(b+2==s.i); + return s; + } + + Struct bar(){ + return Struct.foo() * Struct.foo(); + } + + Struct opMul(Struct s){ + Struct ss; + ss.i = s.i * i; + return ss; + } +} + +int main(){ + Struct s; + assert(s.bar().i==4); + return 0; +} diff -r 1f473003ec30 -r 8c65d48f3d79 run/i/inline_11_C.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/i/inline_11_C.d Fri Jun 24 08:01:20 2005 +0000 @@ -0,0 +1,37 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Victor Nakoryakov +// @date@ 2005-06-25 +// @uri@ news:d9e3af$1olf$1@digitaldaemon.com + +// __DSTRESS_DFLAGS__ -inline + +module dstress.run.i.inline_11_C; + +struct Struct{ + int i; + + Struct foo(){ + Struct s; + int a = i; + int b = s.i; + with (s) { + i+=2; + } + assert(a==i); + assert(b+2==s.i); + return s; + } + + Struct bar(){ + return Struct.foo(); + } +} + +int main(){ + Struct s; + assert(s.bar().i==2); + return 0; +} diff -r 1f473003ec30 -r 8c65d48f3d79 run/i/inline_11_D.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/i/inline_11_D.d Fri Jun 24 08:01:20 2005 +0000 @@ -0,0 +1,37 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Victor Nakoryakov +// @date@ 2005-06-25 +// @uri@ news:d9e3af$1olf$1@digitaldaemon.com + +// __DSTRESS_DFLAGS__ -inline + +module dstress.run.i.inline_11_D; + +struct Struct{ + int i; + + Struct foo(){ + Struct s; + s.i=2; + return s; + } + + Struct bar(){ + return Struct.foo() * Struct.foo(); + } + + Struct opMul(Struct s){ + Struct ss; + ss.i = s.i * i; + return ss; + } +} + +int main(){ + Struct s; + assert(s.bar().i==4); + return 0; +}