Skip to content

Commit

Permalink
testsuite: move architecture-specific logic from tests/asmgen to tools
Browse files Browse the repository at this point in the history
  • Loading branch information
shindere committed Apr 26, 2018
1 parent 3c98b3c commit 65090a8
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 14 deletions.
17 changes: 5 additions & 12 deletions testsuite/tests/asmgen/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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
Expand All @@ -86,9 +85,3 @@ tests: $(CASES:=.$(O))
done

promote:

arch: $(ARCH).$(O)

i386.obj: i386nt.asm
@set -o pipefail ; \
$(ASM) $@ $^ | tail -n +2
17 changes: 15 additions & 2 deletions testsuite/tools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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

Expand All @@ -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

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 65090a8

Please sign in to comment.