Test construction of disjoint graphs and let parameters have references
authorjjenista <jjenista>
Wed, 23 Apr 2008 18:14:17 +0000 (18:14 +0000)
committerjjenista <jjenista>
Wed, 23 Apr 2008 18:14:17 +0000 (18:14 +0000)
to a node in them.  These should not result in an alias.

Robust/src/Tests/OwnershipAnalysisTest/test03/makefile [new file with mode: 0644]
Robust/src/Tests/OwnershipAnalysisTest/test03/test03.java [new file with mode: 0644]

diff --git a/Robust/src/Tests/OwnershipAnalysisTest/test03/makefile b/Robust/src/Tests/OwnershipAnalysisTest/test03/makefile
new file mode 100644 (file)
index 0000000..1afd3a7
--- /dev/null
@@ -0,0 +1,57 @@
+PROGRAM=test03
+
+SOURCE_FILES=test03.java
+
+BUILDSCRIPT=~/research/Robust/src/buildscript
+BSFLAGS= -recover -flatirtasks -ownership -enable-assertions
+#BSFLAGS= -recover -ownership -enable-assertions
+
+all: $(PROGRAM).bin
+
+view: PNGs
+       eog *flatIRGraph*.png &
+       #eog *FN*.png &
+       #eog *Ownership*.png &
+       eog *.png &
+
+printable:
+       rm -f *Startup*.dot
+       rm -f *FlatMethod*.dot
+       rm -f *FlatOpNode*.dot
+       rm -f *FlatFieldNode*.dot
+       rm -f *FlatSetFieldNode*.dot
+       rm -f *FlatCall*.dot
+       rm -f *Parameter*.dot
+       rm -f *Penguin*.dot
+       rm -f *Voo*.dot
+       rm -f *Baw*.dot
+       rm -f *COMPLETE.dot
+       dot2eps *.dot
+
+PNGs: DOTs
+       #rm -f *Startup*.dot
+       rm -f *FlatMethod*.dot
+       rm -f *FlatOpNode*.dot
+       rm -f *FlatFieldNode*.dot
+       rm -f *FlatSetFieldNode*.dot
+       rm -f *FlatCall*.dot
+       rm -f *Parameter*.dot
+       rm -f *Penguin*.dot
+       rm -f *Voo*.dot
+       rm -f *Baw*.dot
+       d2p *.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  *.ps
+       rm -f  *.eps
+       rm -f  identifiedAliases.txt
diff --git a/Robust/src/Tests/OwnershipAnalysisTest/test03/test03.java b/Robust/src/Tests/OwnershipAnalysisTest/test03/test03.java
new file mode 100644 (file)
index 0000000..9aef517
--- /dev/null
@@ -0,0 +1,52 @@
+
+public class Parameter1 {
+    flag w;
+    Node root;
+    public Parameter1() {}
+}
+
+public class Node {
+    HashSet neighbors;
+
+    public Node() {
+       neighbors = new HashSet();
+    }
+
+    public static Node makeNode() {
+       return new Node();
+    }
+
+    public addNeighbor( Node n ) {
+       neighbors.add( n );
+    }
+}
+
+// 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 } ) {
+
+    Parameter1 p1 = new Parameter1();
+
+    taskexit( s{ !initialstate } );
+}
+
+
+task MakeGraph( Parameter1 p1{ !w } ) {
+
+    Node n1 = Node.makeNode();
+    Node n2 = Node.makeNode();
+    Node n3 = Node.makeNode();
+
+    /*
+    n1.addNeighbor( n2 );
+    n2.addNeighbor( n3 );
+    n3.addNeighbor( n1 );
+    */
+
+    p1.root = n1;
+
+
+    taskexit( p1{ w } );
+}
\ No newline at end of file