aboutsummaryrefslogtreecommitdiff
path: root/test_compile.sh
diff options
context:
space:
mode:
authorTeddy <ted.sybil@gmail.com>2014-05-07 03:17:32 +0800
committerTeddy <ted.sybil@gmail.com>2014-05-07 03:17:32 +0800
commit52b29440f8f1310e0c074c8eb409e433c56bdd62 (patch)
tree6d91ceeb6594fe337541ed3f9f50cd33ee8881ca /test_compile.sh
parent0ac22f0214ee283ce9bb053d691aeac823f875be (diff)
rename
Diffstat (limited to 'test_compile.sh')
-rwxr-xr-xtest_compile.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/test_compile.sh b/test_compile.sh
new file mode 100755
index 0000000..073231c
--- /dev/null
+++ b/test_compile.sh
@@ -0,0 +1,18 @@
+#! /bin/bash
+cp cibic compile_data/
+cp lib.s compile_data/
+cd compile_data/
+for f in *.c
+do
+ echo $f
+ ./cibic $f > mips.s 2> /dev/null
+ gcc $f -m32 -std=c99 2> /dev/null
+ ./spim -stat -file mips.s > out
+ ./a.out > std
+ diff std out
+ if [[ "$?" != 0 ]]; then
+ echo "Wrong Answer!"
+ break;
+ fi
+done
+echo "OK."