int sum = 0;
for( int j = 0; j <= i; ++j ) {
sum = calculateStuff( sum, 1, 0 );
- }
+ }
}
sese forceVirtualReal {
if( i % 3 == 0 ) {
for( int l = 0; l < 3; ++l ) {
sum = calculateStuff( sum, 2, 2 );
}
- }
+ }
sese prnt {
mightPrint( x, i, sum, g );
}
-PROGRAM=test
+PROGRAM1=testSingle
+PROGRAM2=testMulti
-SOURCE_FILES=$(PROGRAM).java
+SOURCE_FILES=test.java
BUILDSCRIPT=~/research/Robust/src/buildscript
USEMLP= -mlp 8 2 -mlpdebug # use to turn mlp on and off and make sure rest of build not broken
-BSFLAGS= -nooptimize -debug -garbagestats -mainclass Test -ownership -ownallocdepth 1 -enable-assertions -flatirusermethods #-ownwritedots final -ownaliasfile aliases.txt
+BSFLAGS= -nooptimize -debug -garbagestats -mainclass Test -ownership -ownallocdepth 1 -enable-assertions -ownaliasfile aliases.txt
-all: $(PROGRAM).bin
+all: $(PROGRAM1).bin $(PROGRAM2).bin
-view: PNGs
- eog *.png &
+$(PROGRAM1).bin: $(SOURCE_FILES)
+ $(BUILDSCRIPT) $(BSFLAGS) -o $(PROGRAM1) $(SOURCE_FILES)
-PNGs: DOTs
- d2p *COMPLETE*.dot
-
-DOTs: $(PROGRAM).bin
-
-$(PROGRAM).bin: $(SOURCE_FILES)
- $(BUILDSCRIPT) $(USEMLP) $(BSFLAGS) -o $(PROGRAM) $(SOURCE_FILES)
-
-nomlp: $(SOURCE_FILES)
- $(BUILDSCRIPT) $(BSFLAGS) -o $(PROGRAM) $(SOURCE_FILES)
+$(PROGRAM2).bin: $(SOURCE_FILES)
+ $(BUILDSCRIPT) $(USEMLP) $(BSFLAGS) -o $(PROGRAM2) $(SOURCE_FILES)
clean:
- rm -f $(PROGRAM).bin
+ rm -f $(PROGRAM1).bin
+ rm -f $(PROGRAM2).bin
rm -fr tmpbuilddirectory
rm -f *~
rm -f *.dot
rm -f *.png
rm -f aliases.txt
- rm -f mlpReport*
+ rm -f mlpReport*txt
+ rm -f results*txt
--- /dev/null
+echo 'Each single/multi output line pair should be identical'
+
+echo '' > resultsSingle.txt
+echo '' > resultsMulti.txt
+
+for i in $(seq 3)
+do
+echo 'running...'
+./testSingle.bin $[ i ] >> resultsSingle.txt
+./testMulti.bin $[ i ] >> resultsMulti.txt
+./testSingle.bin $[ i*7 ] >> resultsSingle.txt
+./testMulti.bin $[ i*7 ] >> resultsMulti.txt
+./testSingle.bin $[ 50+i*7 ] >> resultsSingle.txt
+./testMulti.bin $[ 50+i*7 ] >> resultsMulti.txt
+done
+
+echo 'Diffing results'
+diff resultsSingle.txt resultsMulti.txt
int x = Integer.parseInt( args[0] );
Foo f = new Foo( x + 10000 );
doSomeWork( x, f );
- nullMethodBodyFinalNode();
}
public static void doSomeWork( int x, Foo f ) {
+
+ int total = 0;
+
for( int i = 0; i < x; ++i ) {
sese calc {
Foo g = new Foo( i );
- int sum = 0;
- for( int j = 0; j <= i; ++j ) {
- sum = calculateStuff( sum, 1, 0 );
- }
- }
+ int sum = 0;
+ }
sese forceVirtualReal {
if( i % 3 == 0 ) {
sum = sum + (i % 20);
}
if( i % 2 == 0 ) {
sese change {
- for( int k = 0; k < i*2; ++k ) {
- sum = calculateStuff( sum, k, 1 );
- }
sum = sum + 1;
- }
-
- for( int l = 0; l < 3; ++l ) {
- sum = calculateStuff( sum, 2, 2 );
- }
- }
- sese prnt {
- mightPrint( x, i, sum, g );
- }
- }
- }
-
- public static int calculateStuff( int sum, int num, int mode ) {
- int answer = sum;
- sese makePlaceholderStallAfter {
- sum = sum + 1;
+ }
+ }
+ total = total + sum + g.z;
}
- sum = sum + 1;
- if( mode == 0 ) {
- sese mode1 {
- answer = sum + num;
- }
- } else if( mode == 1 ) {
- sese mode2 {
- answer = sum + (num/2);
- }
- } else {
- sese mode3 {
- answer = sum / num;
- }
- }
- return answer;
- }
-
- public static void nullMethodBodyFinalNode() {
- int y = 1;
- sese nothing {
- int x = 0;
- }
- y = x;
- if( x > y ) {
- return;
- } else {
- return;
- }
- }
- public static void mightPrint( int x, int i, int sum, Foo g ) {
- if( i == x - 1 ) {
- System.out.println( "Results "+i+", "+x+", "+sum+", "+g.z );
+ sese prnt {
+ System.out.println( "Results "+x+", "+total );
}
}
}