# HG changeset patch # User thomask # Date 1177351737 0 # Node ID b171e38c078b170bc2fb450a67d5626f18dac6d1 # Parent fcafb2c9da5f67533de51a2fb2166fd65aeb74ab [Issue 1135] invariant keyword parsing is messed up 2007-04-12 http://d.puremagic.com/issues/show_bug.cgi?id=1135 diff -r fcafb2c9da5f -r b171e38c078b run/i/invariant_33_A.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/i/invariant_33_A.d Mon Apr 23 18:08:57 2007 +0000 @@ -0,0 +1,44 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ +// @date@ 2007-04-12 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1135 +// @desc@ [Issue 1135] invariant keyword parsing is messed up + +// __DSTRESS_TORTURE_BLOCK__ -release + +module dstress.run.i.invariant_33_A; + +int state; + +class X{ + synchronized invariant{ + int x; + state += ++x; + } + + void foo(){ + } +} + +int main(){ + X x = new X(); + + x.foo(); + if(2 != state){ + assert(0); + } + + x.foo(); + if(4 != state){ + assert(0); + } + + x.foo(); + if(6 != state){ + assert(0); + } + return 0; +} diff -r fcafb2c9da5f -r b171e38c078b run/i/invariant_33_B.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/i/invariant_33_B.d Mon Apr 23 18:08:57 2007 +0000 @@ -0,0 +1,26 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ +// @date@ 2007-04-12 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1135 +// @desc@ [Issue 1135] invariant keyword parsing is messed up + +module dstress.run.i.invariant_33_B; + +struct X{ + synchronized invariant{ + int x; + } + + void foo(){ + } +} + +int main(){ + X x; + + x.foo(); + return 0; +}