helpful progress reporting
[IRC.git] / Robust / src / Tests / OwnershipAnalysisTest / test01 / test01.java
index d77854626f42173119b560ba01147de305db0d1e..cf4df16aeb65a86dd530c6ec2527fffb465f9c9d 100644 (file)
@@ -1,8 +1,10 @@
-/*
+
 public class Parameter {
   flag w;
-  int a, b;
-  Parameter f, g;
+  int a;
+  int b;
+  Parameter f;
+  Parameter g;
   Penguin p;
   Foo h;
   
@@ -13,7 +15,8 @@ public class Parameter {
 }
 
 public class Penguin {
-  int x, y;
+  int x;
+  int y;
   Foo h;    
   
   public Penguin() { x = 0; y = 0; }
@@ -46,17 +49,6 @@ public class Baw {
   
   public void doTheBaw( Voo v ) { v = new Voo(); }
 }
-*/
-
-
-task ObjectChainByMethodCalls( Foo a{ f } ) {
-
-  Foo f = a.getAFoo();
-  Foo g = a.newFooChain( f );
-  // g -> f
-
-  taskexit( a{ !f } );
-}
 
 
 public class Foo {
@@ -67,7 +59,7 @@ public class Foo {
   public Foo x;
   public Foo y;
   public Foo z;
-
+  public Baw b;
 
   public Foo getAFoo() {
     return new Foo();
@@ -79,8 +71,6 @@ public class Foo {
     return b;
   }
 
-  
-  /*
   public void ruinSomeFoos( Foo a, Foo b ) {
     a.x = b.x;
   }
@@ -174,19 +164,33 @@ public class Foo {
     p0.y = p1;
     p1.y = p0;
   }
-  */
 }
 
 
+
 // 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 } ) {
-    taskexit( s{ !initialstate } );
+
+  Parameter p0 = new Parameter();
+
+  //int a, b, c;
+
+
+  int a = 1;
+  int b = 2;
+  int c = 3;
+
+  b = c;
+  a = b;
+
+
+  taskexit( s{ !initialstate } );
 }
 
-/*
+
 task NewObjectA( Foo a{ f }, Foo b{ f } ) {
 
     Foo c = new Foo();
@@ -341,6 +345,57 @@ task strongUpdates( Foo p0{ f } ) {
 }
 
 
+task ObjectChainByMethodCalls( Foo a{ f } ) {
+
+  Foo f = a.getAFoo();
+  Foo g = a.newFooChain( f );
+  // g -> f
+
+  taskexit( a{ !f } );
+}
+
+
+task arrayAssignments( Foo a{ f } ) {
+
+  Foo f[] = new Foo[3];
+
+  Foo g = new Foo();
+  Foo h = new Foo();
+
+  f[1] = g;
+  f[2] = h;
+
+  Foo i = f[0];
+
+  taskexit( a{ !f } );
+}
+
+
+public class Zool {
+  public Zool() {}
+
+  public static void FooToBaw( Baw x, Foo y ) {
+    x.f.b = y.b;
+  }
+}
+
+task showPrunedEdgesInMethodCall( Foo a{ f } ) {
+
+  Foo b = new Foo();
+  b.x   = a;
+  b.y   = new Foo();
+  b.b   = new Baw();
+
+  Baw c = new Baw();
+  c.f   = new Foo();
+  c.f.b = new Baw();
+  
+  Zool.FooToBaw( c, b );
+
+  taskexit( a{ !f } );
+}
+
+
 task methodTest( Foo p0{ f } ) {
 
     Foo up0 = new Foo();
@@ -606,4 +661,3 @@ task methodTest08_( Foo p0{ f }, Foo p1{ f } ) {
 
   taskexit( p0{ !f }, p1{ !f } );
 }
-*/
\ No newline at end of file