Altered ownership graph to dot file by removing label nodes, marking allocation
[IRC.git] / Robust / src / Tests / OwnershipAnalysisTest / test01 / test01.java
index dbe9ed9d2e893b7677c881fe77e005483de2fc88..26050fc7c51ab6468bd73bd9f66760f63e2fd41b 100644 (file)
@@ -1,4 +1,4 @@
-/*
+
 public class Parameter {
     flag w;
     int a, b;
@@ -18,26 +18,45 @@ public class Penguin {
 
     public void bar() { x = 1; }
 }
-*/
 
 public class Voo {
-    flag f; int x; Baw b;
+    flag f; int x; Baw b; Baw bb;
 
     public Voo() {}
 }
 
 public class Baw {
     flag g; int y;
+    Foo f;
 
     public Baw() {}
+
+    public void doTheBaw( Voo v ) { v = new Voo(); }
 }
 
 
+public class Foo {
+    public Foo() {}
+
+    public Foo x;
+
+    public void ruinSomeFoos( Foo a, Foo b ) {
+       a.x = b.x;
+    }
+}
+
 // this empty task should still create a non-empty
 // ownership graph showing parameter allocation
 // look for the parameter s as a label referencing
 // a heap region that is multi-object, flagged, not summary
 task Startup( StartupObject s{ initialstate } ) {
+    Foo a = new Foo();
+    Foo b = new Foo();
+    Foo c = new Foo();
+    
+    c.ruinSomeFoos( a, b );
+
     taskexit( s{ !initialstate } );
 }
 
@@ -45,8 +64,11 @@ task Startup( StartupObject s{ initialstate } ) {
 // be a heap region for the parameter, and several
 // heap regions for the allocation site, but the label
 // merely points to the newest region
+
 task NewObject( Voo v{ f } ) {
     Voo w = new Voo();
+    Baw b = new Baw();
+    b.doTheBaw( w );
 
     taskexit( v{ !f } );
 }
@@ -67,12 +89,20 @@ task Branch( Voo v{ f } ) {
 }
 
 
-task NewInLoop( Voo v{ f } ) {
+task NoAliasNewInLoop( Voo v{ f } ) {
     Voo w = new Voo();
 
     for( int i = 0; i < 10; ++i ) {
        w.b = new Baw();
+       w.b.f = new Foo();
     }
 
     taskexit( v{ !f } );
 }
+
+
+task ClobberInitParamReflex( Voo v{ f }, Voo w{ f } ) {
+    v.b = v.bb;
+
+    taskexit( v{ !f }, w{ !f } );
+}
\ No newline at end of file