aboutsummaryrefslogtreecommitdiffstats
path: root/test/aarch64/postpass_tests/postpass_exec_c_test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'test/aarch64/postpass_tests/postpass_exec_c_test.sh')
-rwxr-xr-xtest/aarch64/postpass_tests/postpass_exec_c_test.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/aarch64/postpass_tests/postpass_exec_c_test.sh b/test/aarch64/postpass_tests/postpass_exec_c_test.sh
new file mode 100755
index 00000000..73422990
--- /dev/null
+++ b/test/aarch64/postpass_tests/postpass_exec_c_test.sh
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+CLEAN=0
+WOFF=0
+SRC=""
+while getopts ':cwi:' 'OPTKEY'; do
+ case ${OPTKEY} in
+ c) CLEAN=1;;
+ w) WOFF=1;;
+ i) SRC=${OPTARG};;
+ esac
+done
+
+CCOMP="../../../ccomp -static"
+
+if [ $WOFF -eq 1 ]
+then
+ CCOMP="${CCOMP} -w"
+fi
+
+BNAME=$(basename -s .c $SRC)
+SNAME="$BNAME".s
+SREFNAME="$BNAME"_ref.s
+ENAME="$BNAME"
+EREFNAME="$BNAME"_ref
+./$CCOMP -S $SRC -o $SNAME
+./$CCOMP -fno-postpass -S $SRC -o $SREFNAME
+./$CCOMP $SRC -o $ENAME
+./$CCOMP -fno-postpass $SRC -o $EREFNAME
+
+#diff -I '^//*' -y $SNAME $SREFNAME
+
+if [ $CLEAN -eq 1 ]
+then
+ rm $SNAME $SREFNAME $ENAME $EREFNAME
+fi