add a new test case for inference
authoryeom <yeom>
Thu, 22 Mar 2012 18:40:04 +0000 (18:40 +0000)
committeryeom <yeom>
Thu, 22 Mar 2012 18:40:04 +0000 (18:40 +0000)
Robust/src/Tests/ssJava/infer/makefile
Robust/src/Tests/ssJava/infer/test.java
Robust/src/Tests/ssJava/mp3decoder/LayerIIIDecoder.java
Robust/src/Tests/ssJava/mp3decoder/focus.mp3 [new file with mode: 0644]
Robust/src/Tests/ssJava/mp3decoder/makefile
Robust/src/Tests/ssJava/mp3decoder/outputfocusmp3 [new file with mode: 0644]
Robust/src/Tests/ssJava/mp3decoder/ssoutput [new file with mode: 0644]

index 3eac87f..aaedd8d 100644 (file)
@@ -3,15 +3,15 @@ BUILDSCRIPT=../../../buildscript
 PROGRAM=test
 SOURCE_FILES=test.java
 
-BSFLAGS= -32bit -ssjava -ssjavadebug -printlinenum -mainclass $(PROGRAM)  -heapsize-mb 1000 -garbagestats -joptimize -optimize -debug #-nooptimize #src-after-pp #-debug
+BSFLAGS= -32bit -ssjava -ssjavainfer -ssjavadebug -printlinenum -mainclass $(PROGRAM)  -heapsize-mb 1000 -garbagestats -joptimize -optimize -debug #-nooptimize #src-after-pp #-debug
 
-default: $(PROGRAM)s.bin
+default: $(PROGRAM).bin
 
-$(PROGRAM)s.bin: $(SOURCE_FILES) makefile
+$(PROGRAM).bin: $(SOURCE_FILES) makefile
        $(BUILDSCRIPT) $(BSFLAGS) -o $(PROGRAM)s -builddir sing $(SOURCE_FILES) 
 
 clean:
-       rm -f  $(PROGRAM)s.bin
+       rm -f  $(PROGRAM).bin
        rm -fr sing
        rm -f tmp.c
        rm -f  *~
index f448706..c63d810 100644 (file)
@@ -1,22 +1,52 @@
 public class test{
+    
+    int fieldA;
+    int fieldB;
+    int fieldC;
 
-    @LATTICE("OUT<IN")
-       public static void main (@LOC("IN") String args[]){       
+    public static void main (@LOC("IN") String args[]){       
        test t=new test();      
-       int i=0;
        SSJAVA:
-       while(i<100){
-           t.doit();
-           i++;
+       while(true){
+           t.doit();       
        }
     }
     
-    @LATTICE("")
     public void doit(){
-       int a;
-       int b;
-       a = 5;
-       b = a;
+       int localA = 0;
+       int localB = 0;
+       int localC = 0;
+
+       if(localA>100){
+           int localD=50;
+           localC=localD;
+       }else{
+           paramTest(localA,localB,new Foo());
+       }
+    }
+
+    public void paramTest(int paramA, int paramB, Foo paramFooC){
+       int localD = 100;
+       if(paramA>paramB){
+           paramFooC.fooFieldA=50;
+       }else{
+           paramFooC.fooFieldB=localD;
+       }
     }
     
+}
+
+class Foo{
+
+    int fooFieldA;
+    int fooFieldB;
+
+    public int getA(){
+       return fooFieldA;
+    }
+
+    public int getB(){
+       return fooFieldB;
+    }
+
 }
\ No newline at end of file
index af6ac25..0beebb6 100644 (file)
@@ -485,6 +485,8 @@ final class LayerIIIDecoder implements FrameDecoder {
     SSJAVA.arrayinit(scalefac_buffer, 0);
     SSJAVA.arrayinit(nonzero, 576);
     SSJAVA.arrayinit(new_slen, 0);
+    SSJAVA.arrayinit(rawout,0);
+    
     CheckSumHuff = 0;
     // prevblck = new float[2][SBLIMIT * SSLIMIT];
     si = new III_side_info_t();
diff --git a/Robust/src/Tests/ssJava/mp3decoder/focus.mp3 b/Robust/src/Tests/ssJava/mp3decoder/focus.mp3
new file mode 100644 (file)
index 0000000..06a9386
Binary files /dev/null and b/Robust/src/Tests/ssJava/mp3decoder/focus.mp3 differ
index aea76aa..503e2d1 100644 (file)
@@ -3,7 +3,7 @@ BUILDSCRIPT=../../../buildscript
 PROGRAM=MP3Player
 SOURCE_FILES=MP3Player.java
 
-BSFLAGS= -32bit -ssjava -ssjavadebug -mainclass $(PROGRAM)  -heapsize-mb 1000  -nooptimize -debug -garbagestats #-printlinenum #-joptimize
+BSFLAGS= -32bit -ssjava -mainclass $(PROGRAM)  -heapsize-mb 1000  -nooptimize -debug -garbagestats -ssjavadebug #-printlinenum #-joptimize
 
 default: $(PROGRAM)s.bin
 
diff --git a/Robust/src/Tests/ssJava/mp3decoder/outputfocusmp3 b/Robust/src/Tests/ssJava/mp3decoder/outputfocusmp3
new file mode 100644 (file)
index 0000000..45fcfde
--- /dev/null
@@ -0,0 +1,168 @@
+playing focus.mp3...
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+-4777
+-631072
+1293323
+-1326139
+861767
+451288
+-47296
+-1248777
+1925353
+-2179234
+1182947
+683998
+-2517503
+2835485
+-2320058
+2460065
+-2306413
+195502
+1310892
+-1577569
+2430640
+-2328745
+1740775
+-1051879
+-376916
+1246895
+-1709109
+1874073
+-1369555
+601164
+293020
+-738830
+499587
+-630175
+1256735
+-783515
+104125
+-124200
+-342781
+812927
+-998554
+947185
+-717666
+353871
+163304
+-621030
+722986
+-594950
+632691
+-271096
+-144508
+104417
+-298261
+621697
+-447509
+308172
+-393156
+152638
+150214
+-265019
+545920
+-590735
+387837
+-202976
+-59867
+392340
+-483584
+362935
+-348877
+211165
+-163997
+17939
+244738
+-312426
+949236
+-261437
+-240964
+850661
+744267
+-2000037
+-1233522
+130242
+743770
+1774653
+357115
+-1197546
+-1206982
+-843540
+184622
+2128890
+359831
+442096
+-818716
+-689965
+-947304
+773965
+646175
+520632
+-72768
+-630029
+-808955
+-155733
+682029
+576228
+188296
+-67453
+-549263
+-718693
+488039
+350375
+350661
+65091
+-277534
+-1095438
+155867
+396317
+488158
+190983
+-211400
+-626435
+-132469
+118532
+187159
+206311
+312933
+-494249
+-59286
+-154420
+13707
+235088
+178369
+27036
+-238910
+-136433
+8957
+133869
+61867
+159041
+-102253
+-137070
+60010
+-87635
+15930
+209339
+-92839
+-5986
+-38700
+-20011
+26409
+29158
+16768
+-21964
+1477
+0
+0
+0
+0
diff --git a/Robust/src/Tests/ssJava/mp3decoder/ssoutput b/Robust/src/Tests/ssJava/mp3decoder/ssoutput
new file mode 100644 (file)
index 0000000..45fcfde
--- /dev/null
@@ -0,0 +1,168 @@
+playing focus.mp3...
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+-4777
+-631072
+1293323
+-1326139
+861767
+451288
+-47296
+-1248777
+1925353
+-2179234
+1182947
+683998
+-2517503
+2835485
+-2320058
+2460065
+-2306413
+195502
+1310892
+-1577569
+2430640
+-2328745
+1740775
+-1051879
+-376916
+1246895
+-1709109
+1874073
+-1369555
+601164
+293020
+-738830
+499587
+-630175
+1256735
+-783515
+104125
+-124200
+-342781
+812927
+-998554
+947185
+-717666
+353871
+163304
+-621030
+722986
+-594950
+632691
+-271096
+-144508
+104417
+-298261
+621697
+-447509
+308172
+-393156
+152638
+150214
+-265019
+545920
+-590735
+387837
+-202976
+-59867
+392340
+-483584
+362935
+-348877
+211165
+-163997
+17939
+244738
+-312426
+949236
+-261437
+-240964
+850661
+744267
+-2000037
+-1233522
+130242
+743770
+1774653
+357115
+-1197546
+-1206982
+-843540
+184622
+2128890
+359831
+442096
+-818716
+-689965
+-947304
+773965
+646175
+520632
+-72768
+-630029
+-808955
+-155733
+682029
+576228
+188296
+-67453
+-549263
+-718693
+488039
+350375
+350661
+65091
+-277534
+-1095438
+155867
+396317
+488158
+190983
+-211400
+-626435
+-132469
+118532
+187159
+206311
+312933
+-494249
+-59286
+-154420
+13707
+235088
+178369
+27036
+-238910
+-136433
+8957
+133869
+61867
+159041
+-102253
+-137070
+60010
+-87635
+15930
+209339
+-92839
+-5986
+-38700
+-20011
+26409
+29158
+16768
+-21964
+1477
+0
+0
+0
+0