case 3 of definite reach, all coded but has bugs because test case does the messy...
[IRC.git] / Robust / src / Tests / disjoint / definite3 / 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 a = getFlagged();
13     Foo b = getUnflagged();
14     a.f = b;
15
16     // a is flagged and b is reachable from
17     // at most one object from that site
18     gendefreach z0;
19     genreach z0;
20
21     Foo c = new Foo();
22     a.g = c;
23
24     Foo t = getFlagged();
25     t = getFlagged();
26
27     Foo u = getUnflagged();
28     u = getUnflagged();
29
30     // a is flagged and b is reachable from
31     // at most one object from that site, even
32     // though a and b are summarized now.  a
33     // has a reference to a new object c
34     gendefreach z1;
35     genreach z1;
36
37     c.f = b;
38
39     // if we had definite reachability analysis
40     // we would realize b is already reachable
41     // from a
42     gendefreach z3;
43     genreach z3;
44
45     System.out.println( " "+a+b+c );
46   }
47
48   static public Foo getFlagged() {
49     return disjoint jupiter new Foo();
50   }
51
52   static public Foo getUnflagged() {
53     return new Foo();
54   }
55
56 }