aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--test/mppa/Makefile11
-rw-r--r--test/mppa/check.sh56
3 files changed, 42 insertions, 26 deletions
diff --git a/.gitignore b/.gitignore
index 5358ee05..99ec0c72 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,7 @@
# Object files, in general
**.bin
**.out
+**.tok
*.vo
*.glob
*.o
diff --git a/test/mppa/Makefile b/test/mppa/Makefile
index 36bd49bc..6f7ea55a 100644
--- a/test/mppa/Makefile
+++ b/test/mppa/Makefile
@@ -3,6 +3,7 @@ TESTNAMES=simple call branch for forvar forvarl branchz branchzu
TESTS=$(addprefix $(DIR)/,$(TESTNAMES))
ELF=$(addsuffix .bin,$(TESTS))
+TOK=$(addsuffix .tok,$(TESTS))
ASM=$(addsuffix .s,$(TESTS))
DEBUG:=$(if $(DEBUG),"-dall",)
@@ -17,9 +18,14 @@ $(DIR)/%.bin: $(DIR)/%.s
$(DIR)/%.s: $(DIR)/%.c
ccomp $(DEBUG) -O0 -v -S $< -o $@
+$(DIR)/%.tok: $(DIR)/%.bin FORCE
+ @bash check.sh $< $@
+
+.PHONY: FORCE
+FORCE:
+
.PHONY:
-check: $(ELF)
- bash check.sh $(ELF)
+check: $(TOK)
.PHONY:
clean:
@@ -33,6 +39,7 @@ clean:
rm -f $(DIR)/*.parsed.c
rm -f $(DIR)/*.rtl.?
rm -f $(DIR)/*.s
+ rm -f $(DIR)/*.tok
rm -f $(DIR)/output/*.out
rm -rf $(DIR)/profile/
rm -f $(ELF)
diff --git a/test/mppa/check.sh b/test/mppa/check.sh
index 813796d9..8e889175 100644
--- a/test/mppa/check.sh
+++ b/test/mppa/check.sh
@@ -1,29 +1,37 @@
+# $1: binary file to check
+# $2: output check token
-while [ $# -gt 0 ]; do
- elffile="$1"
-
- if [ ! -f $elffile ]; then
- >&2 echo "ERROR: $elffile not found"
- shift; continue
- fi
+elffile="$1"
+token="$2"
- dir="$(dirname $elffile)"
- elf="$(basename $elffile)"
- exp="$dir/output/$elf.exp"
- out="$dir/output/$elf.out"
- if [ ! -f $exp ]; then
- >&2 echo "ERROR: $exp not found"
- shift; continue
- fi
+if [ ! -f $elffile ]; then
+ >&2 echo "ERROR: $elffile not found"
+ shift; continue
+fi
- k1-cluster -- $elffile > $out
- echo $? >> $out
+if [ -f $token ]; then
+ echo "ALREADY PASSED: $elffile"
+ exit
+fi
- if ! diff $exp $out; then
- >&2 echo "ERROR: $exp and $out differ"
- shift; continue
- fi
+dir="$(dirname $elffile)"
+elf="$(basename $elffile)"
+exp="$dir/output/$elf.exp"
+out="$dir/output/$elf.out"
+if [ ! -f $exp ]; then
+ >&2 echo "ERROR: $exp not found"
+ shift; continue
+fi
- echo "PASSED: $elf"
- shift
-done
+k1-cluster -- $elffile > $out
+echo $? >> $out
+
+if ! diff $exp $out; then
+ >&2 echo "ERROR: $exp and $out differ"
+ exit
+ #shift; continue
+fi
+
+echo "PASSED: $elf"
+touch $token
+#shift