From 1eec0ec202fd90bef6e19bc3781d8f7a02f0b356 Mon Sep 17 00:00:00 2001 From: jjenista Date: Wed, 23 Apr 2008 18:14:17 +0000 Subject: [PATCH] Test construction of disjoint graphs and let parameters have references to a node in them. These should not result in an alias. --- .../OwnershipAnalysisTest/test03/makefile | 57 +++++++++++++++++++ .../OwnershipAnalysisTest/test03/test03.java | 52 +++++++++++++++++ 2 files changed, 109 insertions(+) create mode 100644 Robust/src/Tests/OwnershipAnalysisTest/test03/makefile create mode 100644 Robust/src/Tests/OwnershipAnalysisTest/test03/test03.java diff --git a/Robust/src/Tests/OwnershipAnalysisTest/test03/makefile b/Robust/src/Tests/OwnershipAnalysisTest/test03/makefile new file mode 100644 index 00000000..1afd3a70 --- /dev/null +++ b/Robust/src/Tests/OwnershipAnalysisTest/test03/makefile @@ -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 index 00000000..9aef5174 --- /dev/null +++ b/Robust/src/Tests/OwnershipAnalysisTest/test03/test03.java @@ -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 -- 2.34.1