aboutsummaryrefslogtreecommitdiffstats
path: root/test/mppa
diff options
context:
space:
mode:
authorCyril SIX <cyril.six@kalray.eu>2018-11-27 17:17:47 +0100
committerCyril SIX <cyril.six@kalray.eu>2018-11-27 17:17:47 +0100
commit309db6bc63539f2ba10c0cd4088ef3ac2e237551 (patch)
tree7c848602bdc9d370099a846119b6d5eb05babfb5 /test/mppa
parent3d38bf85c8ac3a83fe7aaeb5e01bb9a8403e6a60 (diff)
downloadcompcert-kvx-309db6bc63539f2ba10c0cd4088ef3ac2e237551.tar.gz
compcert-kvx-309db6bc63539f2ba10c0cd4088ef3ac2e237551.zip
Added tests where GCC calls CompCert functions
Diffstat (limited to 'test/mppa')
-rw-r--r--test/mppa/instr/Makefile2
-rw-r--r--test/mppa/interop/Makefile27
-rw-r--r--test/mppa/mmult/Makefile2
-rw-r--r--test/mppa/prng/Makefile2
-rw-r--r--test/mppa/sort/Makefile2
5 files changed, 26 insertions, 9 deletions
diff --git a/test/mppa/instr/Makefile b/test/mppa/instr/Makefile
index 34b5e9ec..27449e88 100644
--- a/test/mppa/instr/Makefile
+++ b/test/mppa/instr/Makefile
@@ -2,7 +2,7 @@ K1CC ?= k1-mbr-gcc
CC ?= gcc
CCOMP ?= ccomp
CFLAGS ?= -O2
-SIMU ?= k1-cluster
+SIMU ?= k1-mppa
TIMEOUT ?= --signal=SIGTERM 20s
DIR=./
diff --git a/test/mppa/interop/Makefile b/test/mppa/interop/Makefile
index 18efaa24..ed3bd23f 100644
--- a/test/mppa/interop/Makefile
+++ b/test/mppa/interop/Makefile
@@ -2,7 +2,7 @@ K1CC ?= k1-mbr-gcc
CC ?= gcc
CCOMP ?= ccomp
CFLAGS ?= -O2
-SIMU ?= k1-cluster
+SIMU ?= k1-mppa
TIMEOUT ?= --signal=SIGTERM 20s
DIR=./
@@ -29,12 +29,14 @@ SIMUPATH=$(shell which $(SIMU))
TESTNAMES=$(filter-out $(COMMON),$(notdir $(subst .c,,$(wildcard $(DIR)/*.c))))
X86_GCC_OUT=$(addprefix $(OUTDIR)/,$(addsuffix .x86-gcc.out,$(TESTNAMES)))
GCC_OUT=$(addprefix $(OUTDIR)/,$(addsuffix .gcc.out,$(TESTNAMES)))
+GCC_REV_OUT=$(addprefix $(OUTDIR)/,$(addsuffix .gcc.rev.out,$(TESTNAMES)))
CCOMP_OUT=$(addprefix $(OUTDIR)/,$(addsuffix .ccomp.out,$(TESTNAMES)))
-OUT=$(X86_GCC_OUT) $(GCC_OUT) $(CCOMP_OUT)
+OUT=$(X86_GCC_OUT) $(GCC_OUT) $(CCOMP_OUT) $(GCC_REV_OUT)
BIN=$(addprefix $(BINDIR)/,$(addsuffix .x86-gcc.bin,$(TESTNAMES)))\
$(addprefix $(BINDIR)/,$(addsuffix .gcc.bin,$(TESTNAMES)))\
- $(addprefix $(BINDIR)/,$(addsuffix .ccomp.bin,$(TESTNAMES)))
+ $(addprefix $(BINDIR)/,$(addsuffix .ccomp.bin,$(TESTNAMES)))\
+ $(addprefix $(BINDIR)/,$(addsuffix .gcc.rev.bin,$(TESTNAMES)))
##
# Targets
@@ -56,16 +58,22 @@ test: $(X86_GCC_OUT) $(GCC_OUT)
done
.PHONY:
-check: $(GCC_OUT) $(CCOMP_OUT)
+check: $(GCC_OUT) $(CCOMP_OUT) $(GCC_REV_OUT)
@echo "Comparing k1 gcc output to ccomp.."
@for test in $(TESTNAMES); do\
gccout=$(OUTDIR)/$$test.gcc.out;\
ccompout=$(OUTDIR)/$$test.ccomp.out;\
+ gccrevout=$(OUTDIR)/$$test.gcc.rev.out;\
if ! diff $$ccompout $$gccout; then\
>&2 echo "ERROR: $$ccompout and $$gccout differ";\
else\
echo "GOOD: $$ccompout and $$gccout concur";\
fi;\
+ if ! diff $$gccrevout $$gccout; then\
+ >&2 echo "ERROR: $$gccrevout and $$gccout differ";\
+ else\
+ echo "GOOD: $$gccrevout and $$gccout concur";\
+ fi;\
done
##
@@ -100,6 +108,10 @@ $(OUTDIR)/%.gcc.out: $(BINDIR)/%.gcc.bin $(SIMUPATH)
@mkdir -p $(@D)
ret=0; timeout $(TIMEOUT) $(SIMU) -- $< > $@ || { ret=$$?; }; echo $$ret >> $@
+$(OUTDIR)/%.gcc.rev.out: $(BINDIR)/%.gcc.rev.bin $(SIMUPATH)
+ @mkdir -p $(@D)
+ ret=0; timeout $(TIMEOUT) $(SIMU) -- $< > $@ || { ret=$$?; }; echo $$ret >> $@
+
$(OUTDIR)/%.ccomp.out: $(BINDIR)/%.ccomp.bin $(SIMUPATH)
@mkdir -p $(@D)
ret=0; timeout $(TIMEOUT) $(SIMU) -- $< > $@ || { ret=$$?; }; echo $$ret >> $@
@@ -128,10 +140,15 @@ $(BINDIR)/%.gcc.bin: $(OBJDIR)/%.gcc.o $(OBJDIR)/$(COMMON).gcc.o $(K1CCPATH)
@mkdir -p $(@D)
$(K1CC) $(CFLAGS) $(wordlist 1,2,$^) -o $@
-$(BINDIR)/%.ccomp.bin: $(OBJDIR)/%.ccomp.o $(OBJDIR)/$(COMMON).ccomp.o $(CCOMPPATH)
+$(BINDIR)/%.gcc.rev.bin: $(OBJDIR)/%.gcc.o $(OBJDIR)/$(COMMON).ccomp.o $(K1CCPATH)
+ @mkdir -p $(@D)
+ $(K1CC) $(CFLAGS) $(wordlist 1,2,$^) -o $@
+
+$(BINDIR)/%.ccomp.bin: $(OBJDIR)/%.ccomp.o $(OBJDIR)/$(COMMON).gcc.o $(CCOMPPATH)
@mkdir -p $(@D)
$(CCOMP) $(CFLAGS) $(wordlist 1,2,$^) -o $@
+
##
# Assembly to object
##
diff --git a/test/mppa/mmult/Makefile b/test/mppa/mmult/Makefile
index cf82e359..5895ce3d 100644
--- a/test/mppa/mmult/Makefile
+++ b/test/mppa/mmult/Makefile
@@ -2,7 +2,7 @@ K1CC ?= k1-mbr-gcc
CC ?= gcc
CCOMP ?= ccomp
CFLAGS ?= -O2
-SIMU ?= k1-cluster
+SIMU ?= k1-mppa
TIMEOUT ?= 10s
K1CCPATH=$(shell which $(K1CC))
diff --git a/test/mppa/prng/Makefile b/test/mppa/prng/Makefile
index 5580cd8e..4770c901 100644
--- a/test/mppa/prng/Makefile
+++ b/test/mppa/prng/Makefile
@@ -2,7 +2,7 @@ K1CC ?= k1-mbr-gcc
CC ?= gcc
CCOMP ?= ccomp
CFLAGS ?= -O2
-SIMU ?= k1-cluster
+SIMU ?= k1-mppa
TIMEOUT ?= 10s
K1CCPATH=$(shell which $(K1CC))
diff --git a/test/mppa/sort/Makefile b/test/mppa/sort/Makefile
index ebbad5b5..5173528c 100644
--- a/test/mppa/sort/Makefile
+++ b/test/mppa/sort/Makefile
@@ -2,7 +2,7 @@ K1CC ?= k1-mbr-gcc
CC ?= gcc
CCOMP ?= ccomp
CFLAGS ?= -O2
-SIMU ?= k1-cluster
+SIMU ?= k1-mppa
TIMEOUT ?= 10s
K1CCPATH=$(shell which $(K1CC))