1512
|
1 // $HeadURL$
|
|
2 // $Date$
|
|
3 // $Author$
|
|
4
|
|
5 // @author@ <torhu@yahoo.com>
|
|
6 // @date@ 2007-04-12
|
|
7 // @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1135
|
|
8 // @desc@ [Issue 1135] invariant keyword parsing is messed up
|
|
9
|
|
10 // __DSTRESS_TORTURE_BLOCK__ -release
|
|
11
|
|
12 module dstress.run.i.invariant_33_A;
|
|
13
|
|
14 int state;
|
|
15
|
|
16 class X{
|
1559
|
17 synchronized invariant(){
|
1512
|
18 int x;
|
|
19 state += ++x;
|
|
20 }
|
|
21
|
|
22 void foo(){
|
|
23 }
|
|
24 }
|
|
25
|
|
26 int main(){
|
|
27 X x = new X();
|
|
28
|
|
29 x.foo();
|
|
30 if(2 != state){
|
|
31 assert(0);
|
|
32 }
|
|
33
|
|
34 x.foo();
|
|
35 if(4 != state){
|
|
36 assert(0);
|
|
37 }
|
|
38
|
|
39 x.foo();
|
|
40 if(6 != state){
|
|
41 assert(0);
|
|
42 }
|
|
43 return 0;
|
|
44 }
|