small test
authorbdemsky <bdemsky>
Mon, 23 Mar 2009 19:44:45 +0000 (19:44 +0000)
committerbdemsky <bdemsky>
Mon, 23 Mar 2009 19:44:45 +0000 (19:44 +0000)
Robust/src/Tests/OwnershipAnalysisTest/smalltest/makefile [new file with mode: 0644]
Robust/src/Tests/OwnershipAnalysisTest/smalltest/small.java [new file with mode: 0644]

diff --git a/Robust/src/Tests/OwnershipAnalysisTest/smalltest/makefile b/Robust/src/Tests/OwnershipAnalysisTest/smalltest/makefile
new file mode 100644 (file)
index 0000000..1209961
--- /dev/null
@@ -0,0 +1,30 @@
+MAIN_CLASS=small #smalltest
+
+PROGRAM=test
+SOURCE_FILES=small.java #smalltest.java
+
+BUILDSCRIPT=~/research/Robust/src/buildscript
+BSFLAGS= -debug -nooptimize -mainclass $(MAIN_CLASS) -justanalyze -ownership -ownallocdepth 1 -ownwritedots final -ownaliasfile aliases.txt -enable-assertions
+
+all: $(PROGRAM).bin
+
+view: PNGs
+       eog *.png &
+
+PNGs: DOTs
+       d2p *COMPLETE*.dot
+
+DOTs: $(PROGRAM).bin
+
+$(PROGRAM).bin: $(SOURCE_FILES)
+       $(BUILDSCRIPT) $(BSFLAGS) -o $(PROGRAM) $(SOURCE_FILES)
+
+clean:
+       rm -f  $(PROGRAM).bin
+       rm -fr tmpbuilddirectory
+       rm -f  *~
+       rm -f  *.dot
+       rm -f  *.png
+       rm -f  aliases.txt
+       rm -f  output.txt
+
diff --git a/Robust/src/Tests/OwnershipAnalysisTest/smalltest/small.java b/Robust/src/Tests/OwnershipAnalysisTest/smalltest/small.java
new file mode 100644 (file)
index 0000000..20b4a74
--- /dev/null
@@ -0,0 +1,43 @@
+class small {
+    tiny t1;
+    foo[] f;
+
+    public small(tiny t) {
+       t1=t;
+       f=new foo[100];
+    }
+
+    public static void main(String x[]) {
+       tiny t=new tiny();
+       small s=new small(t);
+       s.process();
+    }
+
+    void process() {
+       while(true) {
+           createfoo();
+       }
+    }
+    
+    public void createfoo() {
+       foo f=disjoint test new foo();
+       this.f[0]=f;
+       f.t1=t1;
+    }
+
+
+}
+
+public class tiny {
+    int x;
+    public tiny() {
+
+    }
+}
+
+public class foo {
+    tiny t1;
+    public foo() {
+
+    }
+}
\ No newline at end of file