5970eff5189c692518ca1f3639b8f167b81df45e
[IRC.git] / Robust / src / Tests / disjoint / definite / test.java
1 public class Foo {
2   public Foo f;
3   public Foo g;
4 }
5
6 public class Test {
7
8   
9
10   static public void main( String args[] ) {
11
12     Foo x = getFlagged();
13     Foo y = getUnflagged();
14
15     x.f = y;
16
17     gendefreach QWQ1; 
18
19     Foo z = x;
20     while( false ) {
21       z = z.f;
22     }
23
24     gendefreach QWQ2;
25
26     /*
27     gendefreach yn1;    
28
29     Foo x = getFlagged();
30     Foo y = getUnflagged();
31     x.f = y;
32
33     // x is flagged and y is reachable from
34     // at most one object from that site
35     gendefreach y0;
36     genreach y0;
37
38     Foo t = getFlagged();
39     t = getFlagged();
40
41     // x is flagged and y is reachable from
42     // at most one object from that site, even
43     // though x is summarized now
44     gendefreach y1;
45     genreach y1;
46
47     x.g = y;
48
49     // if we had definite reachability analysis
50     // we would realize y is already reachable
51     // from x, but we don't and x is summarized
52     // so we conservatively increase the arity
53     // of objects y is reachable from.
54     gendefreach y2;
55     genreach y2;
56     */
57
58     System.out.println( " "+x+y+z );
59   }
60
61   static public Foo getFlagged() {
62     return disjoint jupiter new Foo();
63   }
64
65   static public Foo getUnflagged() {
66     return new Foo();
67   }
68
69 }