From aa3d4de757e30ff5e065c06b527fcdd5c562cc11 Mon Sep 17 00:00:00 2001 From: jjenista Date: Mon, 30 Mar 2009 21:58:07 +0000 Subject: [PATCH] a new tiny test and better SESE node printing --- Robust/src/IR/Flat/FlatSESEEnterNode.java | 2 +- Robust/src/IR/Flat/FlatSESEExitNode.java | 3 +- Robust/src/Tests/mlp/syntaxTest/makefile | 2 +- Robust/src/Tests/mlp/syntaxTest/test.java | 17 +++++------ Robust/src/Tests/mlp/tinyTest/makefile | 27 +++++++++++++++++ Robust/src/Tests/mlp/tinyTest/test.java | 37 +++++++++++++++++++++++ 6 files changed, 76 insertions(+), 12 deletions(-) create mode 100644 Robust/src/Tests/mlp/tinyTest/makefile create mode 100644 Robust/src/Tests/mlp/tinyTest/test.java diff --git a/Robust/src/IR/Flat/FlatSESEEnterNode.java b/Robust/src/IR/Flat/FlatSESEEnterNode.java index 344526f1..a56d8972 100644 --- a/Robust/src/IR/Flat/FlatSESEEnterNode.java +++ b/Robust/src/IR/Flat/FlatSESEEnterNode.java @@ -22,7 +22,7 @@ public class FlatSESEEnterNode extends FlatNode { } public String toString() { - return "sese enter"; + return "sese "+id+" enter"; } public void setFlatExit( FlatSESEExitNode fsexn ) { diff --git a/Robust/src/IR/Flat/FlatSESEExitNode.java b/Robust/src/IR/Flat/FlatSESEExitNode.java index a5b4f9b8..7aa954f4 100644 --- a/Robust/src/IR/Flat/FlatSESEExitNode.java +++ b/Robust/src/IR/Flat/FlatSESEExitNode.java @@ -23,7 +23,8 @@ public class FlatSESEExitNode extends FlatNode { } public String toString() { - return "seseexit"; + assert enter != null; + return "sese "+enter.getIdentifier()+" exit"; } public int kind() { diff --git a/Robust/src/Tests/mlp/syntaxTest/makefile b/Robust/src/Tests/mlp/syntaxTest/makefile index dafc6056..335dd500 100644 --- a/Robust/src/Tests/mlp/syntaxTest/makefile +++ b/Robust/src/Tests/mlp/syntaxTest/makefile @@ -3,7 +3,7 @@ PROGRAM=test SOURCE_FILES=$(PROGRAM).java BUILDSCRIPT=~/research/Robust/src/buildscript -BSFLAGS= -justanalyze -ownership -ownallocdepth 1 -ownwritedots final -enable-assertions -flatirtasks #-recover -ownaliasfile aliases.txt +BSFLAGS= -mainclass Test -ownership -ownallocdepth 1 -ownwritedots final -enable-assertions -flatirusermethods -ownaliasfile aliases.txt #-justanalyze -recover all: $(PROGRAM).bin diff --git a/Robust/src/Tests/mlp/syntaxTest/test.java b/Robust/src/Tests/mlp/syntaxTest/test.java index 9dffe092..362fcf0b 100644 --- a/Robust/src/Tests/mlp/syntaxTest/test.java +++ b/Robust/src/Tests/mlp/syntaxTest/test.java @@ -1,17 +1,16 @@ public class Test { public static void main( String args[] ) { - - /* - int a = 0; + + int a = 0; sese { int x = 3; } - a = x; - + a = x; + /* sese { int y = 4; y+=4; @@ -19,17 +18,17 @@ public class Test { sese { int z = x + y; z+=6; - Integer n=new Integer(23); + //Integer n=new Integer(23); } } - x = y + z; + x = y + z; */ + /* Integer r = disjoint t1 new Integer(23); - int[] s = disjoint t2 new int[10]; - Integer[] t = disjoint t3 new Integer[10]; + */ } } diff --git a/Robust/src/Tests/mlp/tinyTest/makefile b/Robust/src/Tests/mlp/tinyTest/makefile new file mode 100644 index 00000000..335dd500 --- /dev/null +++ b/Robust/src/Tests/mlp/tinyTest/makefile @@ -0,0 +1,27 @@ +PROGRAM=test + +SOURCE_FILES=$(PROGRAM).java + +BUILDSCRIPT=~/research/Robust/src/buildscript +BSFLAGS= -mainclass Test -ownership -ownallocdepth 1 -ownwritedots final -enable-assertions -flatirusermethods -ownaliasfile aliases.txt #-justanalyze -recover + +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 diff --git a/Robust/src/Tests/mlp/tinyTest/test.java b/Robust/src/Tests/mlp/tinyTest/test.java new file mode 100644 index 00000000..81be3a43 --- /dev/null +++ b/Robust/src/Tests/mlp/tinyTest/test.java @@ -0,0 +1,37 @@ +public class Test { + + public static void main( String args[] ) { + + int n = 10; + + sese { + + int[] a = new int[n]; + int[] b = new int[n]; + int[] c = new int[n]; + + for( int i = 0; i < n; ++i ) { + sese { + a[i] = i; + b[i] = n - i; + } + } + + for( int j = 0; j < n; ++j ) { + sese { + c[j] = a[j] + b[j]; + } + } + + int total = 0; + for( int k = 0; k < n; ++k ) { + sese { + total = total + c[k]; + } + } + + System.out.println( "total is "+total ); + } + + } +} -- 2.34.1