374
|
1 // $HeadURL$
|
|
2 // $Date$
|
|
3 // $Author$
|
|
4
|
736
|
5 // __DSTRESS_TORTURE_BLOCK__ -release
|
|
6
|
374
|
7 module dstress.run.invariant_13;
|
59
|
8
|
|
9 class Parent{
|
|
10 int x;
|
|
11
|
|
12 void test(){
|
|
13 }
|
|
14
|
1559
|
15 invariant(){
|
59
|
16 // even number
|
1559
|
17 if(x & 1){
|
|
18 assert(0);
|
|
19 }
|
59
|
20 }
|
|
21 }
|
|
22
|
|
23 class Child : Parent{
|
|
24 }
|
|
25
|
|
26 class GrandChild : Child{
|
|
27 this(int x){
|
|
28 this.x=x;
|
|
29 }
|
|
30
|
1559
|
31 invariant(){
|
|
32 if(x <= 2){
|
|
33 assert(0);
|
|
34 }
|
59
|
35 }
|
|
36 }
|
|
37
|
|
38 int main(){
|
|
39 try{
|
|
40 GrandChild gc = new GrandChild(2);
|
|
41 }catch{
|
|
42 return 0;
|
|
43 }
|
|
44 assert(0);
|
|
45 }
|