diff --git a/.gitattributes b/.gitattributes index df876d1aa32dc001b2ec2faddfa8c4f189a3e186..f75ec3eaf3869749cef4d59464c966b055f7e96b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -536,6 +536,7 @@ tests/spec/gcc_exp/expr2.s -text tests/spec/gcc_exp/g23.s -text tests/spec/gcc_exp/s04.s -text tests/spec/gcc_exp/scilab.s -text +tests/spec/gcc_test.sh -text tests/spec/gobmk -text tests/spec/h264ref -text tests/spec/h264ref_exp/act.err -text diff --git a/tests/spec/gcc_test.sh b/tests/spec/gcc_test.sh new file mode 100755 index 0000000000000000000000000000000000000000..9de5d7246a3f93a21373a491da3169d9522b0bd7 --- /dev/null +++ b/tests/spec/gcc_test.sh @@ -0,0 +1,102 @@ +#!/bin/sh + +INPUT_DIR=$SPEC_HOME/benchspec/CPU2006/403.gcc/data/ref/input +BENCH_DIR=$SECURITY_TRANSFORMS_HOME/tests/spec/gcc_exp + +cleanup() +{ + rm -rf act.out act.err empty +} + +validate() +{ + status=$1 + orig_out=$2 + rm -f empty + touch empty + + if [ $status -ne 0 ]; then + echo "TEST WRAPPER FAILURE: Exit Status Non-Zero: $status" + cleanup + exit 1 + fi + + diff empty act.err + + if [ $? -ne 0 ];then + echo "TEST WRAPPER FAILURE: Error Output Differs from Expected" + cleanup + exit 1 + fi + + diff act.out $orig_out + if [ $? -ne 0 ];then + echo "TEST WRAPPER FAILURE: Actual Output Differs from Expected" + cleanup + exit 1 + fi + +} + +cleanup +echo "$1 $INPUT_DIR/166.i -o act.out 2>act.err" +$1 $INPUT_DIR/166.i -o act.out 2>act.err +status=$? +validate $status $BENCH_DIR/166.s + +cleanup +echo "$1 $INPUT_DIR/scilab.i -o act.out 2>act.err" +$1 $INPUT_DIR/scilab.i -o act.out 2>act.err +status=$? +validate $status $BENCH_DIR/scilab.s + +cleanup +echo "$1 $INPUT_DIR/200.i -o act.out 2>act.err" +$1 $INPUT_DIR/200.i -o act.out 2>act.err +status=$? +validate $status $BENCH_DIR/200.s + +cleanup +echo "$1 $INPUT_DIR/c-typeck.i -o act.out 2>act.err" +$1 $INPUT_DIR/c-typeck.i -o act.out 2>act.err +status=$? +validate $status $BENCH_DIR/c-typeck.s + +cleanup +echo "$1 $INPUT_DIR/cp-decl.i -o act.out 2>act.err" +$1 $INPUT_DIR/cp-decl.i -o act.out 2>act.err +status=$? +validate $status $BENCH_DIR/cp-decl.s + +cleanup +echo "$1 $INPUT_DIR/expr.i -o act.out 2>act.err" +$1 $INPUT_DIR/expr.i -o act.out 2>act.err +status=$? +validate $status $BENCH_DIR/expr.s + +cleanup +echo "$1 $INPUT_DIR/expr2.i -o act.out 2>act.err" +$1 $INPUT_DIR/expr2.i -o act.out 2>act.err +status=$? +validate $status $BENCH_DIR/expr2.s + +cleanup +echo "$1 $INPUT_DIR/g23.i -o act.out 2>act.err" +$1 $INPUT_DIR/g23.i -o act.out 2>act.err +status=$? +validate $status $BENCH_DIR/g23.s + +cleanup +echo "$1 $INPUT_DIR/s04.i -o act.out 2>act.err" +$1 $INPUT_DIR/s04.i -o act.out 2>act.err +status=$? +validate $status $BENCH_DIR/s04.s + +cleanup + +echo "TEST WRAPPER SUCCESS" +exit 0 + + + +