2018-12-06 20:59:45 +03:00
|
|
|
# -*- Mode: makefile -*-
|
|
|
|
#
|
|
|
|
# Cris tests
|
|
|
|
#
|
|
|
|
# Currently we can only build the "bare" tests with the docker
|
|
|
|
# supplied cross-compiler.
|
|
|
|
#
|
|
|
|
|
|
|
|
CRIS_SRC = $(SRC_PATH)/tests/tcg/cris/bare
|
|
|
|
CRIS_ALL = $(wildcard $(CRIS_SRC)/*.s)
|
|
|
|
CRIS_TESTS = $(patsubst $(CRIS_SRC)/%.s, %, $(CRIS_ALL))
|
|
|
|
# Filter out common blobs and broken tests
|
|
|
|
CRIS_BROKEN_TESTS = crt check_jsr
|
|
|
|
# upstream GCC doesn't support v32
|
|
|
|
CRIS_BROKEN_TESTS += check_mcp check_mulv32 check_addiv32 check_movpmv32
|
|
|
|
CRIS_BROKEN_TESTS += check_movprv32 check_clearfv32 check_movemrv32 check_bas
|
|
|
|
CRIS_BROKEN_TESTS += check_lapc check_movei
|
|
|
|
# no sure why
|
|
|
|
CRIS_BROKEN_TESTS += check_scc check_xarith
|
|
|
|
|
|
|
|
CRIS_USABLE_TESTS = $(filter-out $(CRIS_BROKEN_TESTS), $(CRIS_TESTS))
|
|
|
|
CRIS_RUNS = $(patsubst %, run-%, $(CRIS_USABLE_TESTS))
|
|
|
|
|
|
|
|
# override the list of tests, as we can't build the multiarch tests
|
|
|
|
TESTS = $(CRIS_USABLE_TESTS)
|
2020-04-30 22:01:21 +03:00
|
|
|
EXTRA_RUNS =
|
2018-12-06 20:59:45 +03:00
|
|
|
VPATH = $(CRIS_SRC)
|
|
|
|
|
|
|
|
AS = $(CC) -x assembler-with-cpp
|
|
|
|
LD = $(CC)
|
|
|
|
|
|
|
|
# we rely on GCC inline:ing the stuff we tell it to in many places here.
|
2023-10-29 17:50:16 +03:00
|
|
|
CFLAGS = -Winline -Wall -g -O2 -static -fno-stack-protector
|
2018-12-06 20:59:45 +03:00
|
|
|
NOSTDFLAGS = -nostartfiles -nostdlib
|
|
|
|
ASFLAGS += -mcpu=v10 -g -Wa,-I,$(SRC_PATH)/tests/tcg/cris/bare
|
|
|
|
CRT_FILES = crt.o sys.o
|
|
|
|
|
|
|
|
# stop make deleting crt files if build fails
|
|
|
|
.PRECIOUS: $(CRT_FILES)
|
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
$(CC) -c $< -o $@
|
|
|
|
|
|
|
|
%.o: %.s
|
|
|
|
$(AS) $(ASFLAGS) -c $< -o $@
|
|
|
|
|
|
|
|
%: %.s $(CRT_FILES)
|
|
|
|
$(CC) $(ASFLAGS) $< -o $@ $(LDFLAGS) $(NOSTDFLAGS) $(CRT_FILES)
|
|
|
|
|
|
|
|
# The default CPU breaks (possibly as it's max?) so force crisv17
|
2019-10-11 11:28:26 +03:00
|
|
|
QEMU_OPTS=-cpu crisv17
|
2018-12-06 20:59:45 +03:00
|
|
|
|
|
|
|
# Additional runners to run under GNU SIM
|
|
|
|
CRIS_RUNS_ON_SIM=$(patsubst %, %-on-sim, $(CRIS_RUNS))
|
|
|
|
SIMG:=cris-axis-linux-gnu-run
|
|
|
|
|
|
|
|
# e.g.: make -f ../../tests/tcg/Makefile run-check_orm-on-sim
|
|
|
|
run-%-on-sim:
|
2022-09-29 14:42:03 +03:00
|
|
|
$(call run-test, $<, $(SIMG) $<)
|
2023-04-24 12:22:44 +03:00
|
|
|
|
|
|
|
# We don't currently support the multiarch tests
|
|
|
|
undefine MULTIARCH_TESTS
|