From 65090a836f57fa9359edf00f3056bad67fa5f512 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Hinderer?= Date: Thu, 26 Apr 2018 10:21:31 +0200 Subject: [PATCH] testsuite: move architecture-specific logic from tests/asmgen to tools --- testsuite/tests/asmgen/Makefile | 17 +++++------------ testsuite/tools/Makefile | 17 +++++++++++++++-- .../asmgen/amd64.S => tools/asmgen_amd64.S} | 0 .../{tests/asmgen/arm.S => tools/asmgen_arm.S} | 0 .../asmgen/arm64.S => tools/asmgen_arm64.S} | 0 .../asmgen/i386.S => tools/asmgen_i386.S} | 0 .../i386nt.asm => tools/asmgen_i386nt.asm} | 0 .../asmgen/power.S => tools/asmgen_power.S} | 0 .../asmgen/s390x.S => tools/asmgen_s390x.S} | 0 9 files changed, 20 insertions(+), 14 deletions(-) rename testsuite/{tests/asmgen/amd64.S => tools/asmgen_amd64.S} (100%) rename testsuite/{tests/asmgen/arm.S => tools/asmgen_arm.S} (100%) rename testsuite/{tests/asmgen/arm64.S => tools/asmgen_arm64.S} (100%) rename testsuite/{tests/asmgen/i386.S => tools/asmgen_i386.S} (100%) rename testsuite/{tests/asmgen/i386nt.asm => tools/asmgen_i386nt.asm} (100%) rename testsuite/{tests/asmgen/power.S => tools/asmgen_power.S} (100%) rename testsuite/{tests/asmgen/s390x.S => tools/asmgen_s390x.S} (100%) diff --git a/testsuite/tests/asmgen/Makefile b/testsuite/tests/asmgen/Makefile index aa8af03fa..b170f931c 100644 --- a/testsuite/tests/asmgen/Makefile +++ b/testsuite/tests/asmgen/Makefile @@ -22,9 +22,7 @@ default: $(MAKE) all; \ fi -all: - @$(MAKE) arch - @$(MAKE) tests +all: tests CASES=fib tak quicksort quicksort2 soli \ arith checkbound tagged-fib tagged-integr tagged-quicksort tagged-tak \ @@ -52,16 +50,17 @@ skips: echo " ... testing '$$c': => skipped"; \ done +include $(BASEDIR)/makefiles/Makefile.common +archmod = $(OTOPDIR)/testsuite/tools/asmgen_$(ARCH).$(O) + one: - @$(call CCOMP,$(NAME).out $(ARGS_$(NAME)) $(NAME).$(O) $(ARCH).$(O)) \ + @$(call CCOMP,$(NAME).out $(ARGS_$(NAME)) $(NAME).$(O) $(archmod)) \ && echo " => passed" || echo " => failed" clean: defaultclean @rm -f *.out *.out.manifest *.$(O) *.exe @rm -f $(CASES:=.s) -include $(BASEDIR)/makefiles/Makefile.common - ifeq "$(CCOMPTYPE)-$(ARCH)" "msvc-amd64" # these tests are not ported to MSVC64 yet SKIP=true @@ -86,9 +85,3 @@ tests: $(CASES:=.$(O)) done promote: - -arch: $(ARCH).$(O) - -i386.obj: i386nt.asm - @set -o pipefail ; \ - $(ASM) $@ $^ | tail -n +2 diff --git a/testsuite/tools/Makefile b/testsuite/tools/Makefile index f0c1918c5..2b0ac0f99 100644 --- a/testsuite/tools/Makefile +++ b/testsuite/tools/Makefile @@ -13,6 +13,7 @@ #************************************************************************** BASEDIR=.. +include $(BASEDIR)/../config/Makefile expect_MAIN=expect_test expect_PROG=$(expect_MAIN)$(EXE) expect_COMPFLAGS=-I $(OTOPDIR)/parsing -I $(OTOPDIR)/utils \ @@ -37,10 +38,18 @@ codegen_OBJECTS=parsecmmaux.cmo parsecmm.cmo lexcmm.cmo codegen_main.cmo codegen_ADD_COMPFLAGS=$(codegen_INCLUDES) -w -40 -g -all: $(expect_PROG) codegen +ifeq "$(CCOMPTYPE)-$(ARCH)" "msvc-amd64" +# The asmgen tests are not ported to MSVC64 yet +# so do not compile any arch-specific module +arch_target := +else +arch_target := asmgen_$(ARCH).$(O) +endif + +all: $(expect_PROG) codegen $(arch_target) $(expect_PROG): $(expect_LIBRARIES:=.cma) $(expect_MAIN).cmo - $(OCAMLC) -linkall -o $@ $^ + @$(OCAMLC) -linkall -o $@ $^ include $(BASEDIR)/makefiles/Makefile.common @@ -64,3 +73,7 @@ parsecmm.mli parsecmm.ml: parsecmm.mly lexcmm.ml: lexcmm.mll @$(OCAMLLEX) -q lexcmm.mll +asmgen_i386.obj: asmgen_i386nt.asm + @set -o pipefail ; \ + $(ASM) $@ $^ | tail -n +2 + diff --git a/testsuite/tests/asmgen/amd64.S b/testsuite/tools/asmgen_amd64.S similarity index 100% rename from testsuite/tests/asmgen/amd64.S rename to testsuite/tools/asmgen_amd64.S diff --git a/testsuite/tests/asmgen/arm.S b/testsuite/tools/asmgen_arm.S similarity index 100% rename from testsuite/tests/asmgen/arm.S rename to testsuite/tools/asmgen_arm.S diff --git a/testsuite/tests/asmgen/arm64.S b/testsuite/tools/asmgen_arm64.S similarity index 100% rename from testsuite/tests/asmgen/arm64.S rename to testsuite/tools/asmgen_arm64.S diff --git a/testsuite/tests/asmgen/i386.S b/testsuite/tools/asmgen_i386.S similarity index 100% rename from testsuite/tests/asmgen/i386.S rename to testsuite/tools/asmgen_i386.S diff --git a/testsuite/tests/asmgen/i386nt.asm b/testsuite/tools/asmgen_i386nt.asm similarity index 100% rename from testsuite/tests/asmgen/i386nt.asm rename to testsuite/tools/asmgen_i386nt.asm diff --git a/testsuite/tests/asmgen/power.S b/testsuite/tools/asmgen_power.S similarity index 100% rename from testsuite/tests/asmgen/power.S rename to testsuite/tools/asmgen_power.S diff --git a/testsuite/tests/asmgen/s390x.S b/testsuite/tools/asmgen_s390x.S similarity index 100% rename from testsuite/tests/asmgen/s390x.S rename to testsuite/tools/asmgen_s390x.S