a new tiny test and better SESE node printing
authorjjenista <jjenista>
Mon, 30 Mar 2009 21:58:07 +0000 (21:58 +0000)
committerjjenista <jjenista>
Mon, 30 Mar 2009 21:58:07 +0000 (21:58 +0000)
Robust/src/IR/Flat/FlatSESEEnterNode.java
Robust/src/IR/Flat/FlatSESEExitNode.java
Robust/src/Tests/mlp/syntaxTest/makefile
Robust/src/Tests/mlp/syntaxTest/test.java
Robust/src/Tests/mlp/tinyTest/makefile [new file with mode: 0644]
Robust/src/Tests/mlp/tinyTest/test.java [new file with mode: 0644]

index 344526f1e104e27a077c9e18ff61516157997403..a56d8972e1acb54a1fd82e1b39f0189f73ed8c0f 100644 (file)
@@ -22,7 +22,7 @@ public class FlatSESEEnterNode extends FlatNode {
   }
 
   public String toString() {
-    return "sese enter";
+    return "sese "+id+" enter";
   }
 
   public void setFlatExit( FlatSESEExitNode fsexn ) {
index a5b4f9b8cf7feef762bb3028118580bed3d2a5f8..7aa954f4164091bcdad6e64c721be065a48e4fa3 100644 (file)
@@ -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() {
index dafc6056272313ff9fdcfe9a44ce02d8c51f0106..335dd500bf4811585b43294a2c32cee2be760bce 100644 (file)
@@ -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
 
index 9dffe0924c5820fd1be377f17da2b31d47c1270b..362fcf0b996356b7b64b08172c68a32f5ba90efc 100644 (file)
@@ -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 (file)
index 0000000..335dd50
--- /dev/null
@@ -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 (file)
index 0000000..81be3a4
--- /dev/null
@@ -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 );
+    }
+
+  }
+}