a test that shows reachabiltiy states are broken
authorjjenista <jjenista>
Fri, 12 Mar 2010 19:59:57 +0000 (19:59 +0000)
committerjjenista <jjenista>
Fri, 12 Mar 2010 19:59:57 +0000 (19:59 +0000)
Robust/src/Tests/disjoint/predicateTest3/makefile [new file with mode: 0644]
Robust/src/Tests/disjoint/predicateTest3/test.java [new file with mode: 0644]

diff --git a/Robust/src/Tests/disjoint/predicateTest3/makefile b/Robust/src/Tests/disjoint/predicateTest3/makefile
new file mode 100644 (file)
index 0000000..5ecb5c3
--- /dev/null
@@ -0,0 +1,41 @@
+PROGRAM=test
+
+SOURCE_FILES=$(PROGRAM).java
+
+BUILDSCRIPT=~/research/Robust/src/buildscript
+
+#DEBUGFLAGS= -disjoint-debug-callsite Bar addSomething 1
+#DEBUGFLAGS= -disjoint-debug-callsite Foo main 1
+
+#DEBUGFLAGS= -disjoint-debug-callsite main analysisEntryMethod 1
+#DEBUGFLAGS= -disjoint-debug-callsite addSomething main 1
+#DEBUGFLAGS= -disjoint-debug-callsite addBar addSomething 1
+#DEBUGFLAGS= -disjoint-debug-callsite Bar addBar 1
+#DEBUGFLAGS=
+
+BSFLAGS= -mainclass Test -justanalyze -disjoint -disjoint-k 2 -disjoint-write-dots final -disjoint-write-ihms -disjoint-alias-file aliases.txt normal -enable-assertions
+
+all: $(PROGRAM).bin
+
+view: PNGs
+       eog *.png &
+
+PNGs: DOTs
+       d2p *COMPLETE*.dot
+
+DOTs: $(PROGRAM).bin
+
+$(PROGRAM).bin: $(SOURCE_FILES)
+       $(BUILDSCRIPT) $(BSFLAGS) $(DEBUGFLAGS) -o $(PROGRAM) $(SOURCE_FILES)
+
+OLDBSFLAGS= -mainclass Test -justanalyze -ownership -ownallocdepth 1 -ownwritedots final -enable-assertions
+old: $(SOURCE_FILES)
+       $(BUILDSCRIPT) $(OLDBSFLAGS) -o $(PROGRAM) $(SOURCE_FILES)
+
+clean:
+       rm -f  $(PROGRAM).bin
+       rm -fr tmpbuilddirectory
+       rm -f  *~
+       rm -f  *.dot
+       rm -f  *.png
+       rm -f  aliases.txt
diff --git a/Robust/src/Tests/disjoint/predicateTest3/test.java b/Robust/src/Tests/disjoint/predicateTest3/test.java
new file mode 100644 (file)
index 0000000..256cbdd
--- /dev/null
@@ -0,0 +1,43 @@
+public class Foo {
+  public Foo() {}
+  public Foo f;
+  public Bar b;
+}
+
+public class Bar {
+  public Bar() {}
+}
+
+public class Test {
+
+  static public void main( String[] args ) {
+
+    Foo f1 = disjoint high1 new Foo();
+    Foo extraVar = f1;
+    addSomething( f1 );
+    
+    Foo f2 = disjoint high2 new Foo();
+    addSomething( f2 );    
+
+
+    Foo f3 = getAFoo();
+    Foo f4 = getAFoo();
+    f3.f = f4;
+  }   
+
+  public static void addSomething( Foo f ) {
+    addBar( f );
+  }
+
+  public static void addBar( Foo g ) {    
+    if( true ) {
+      g.b = disjoint low1 new Bar();
+    } else {
+      g.b = disjoint low2 new Bar();
+    }    
+  }
+
+  public static Foo getAFoo() {
+    return new Foo();
+  }
+}