annotate run/i/invariant_33_A.d @ 1559:ec5e144583ea

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