2018-12-06 20:12:44 +03:00
|
|
|
#
|
2023-10-04 12:06:20 +03:00
|
|
|
# Xtensa system tests
|
2018-12-06 20:12:44 +03:00
|
|
|
#
|
|
|
|
|
2021-10-02 08:01:52 +03:00
|
|
|
CORE=dc232b
|
|
|
|
ifneq ($(shell $(QEMU) -cpu help | grep -w $(CORE)),)
|
2018-12-06 20:12:44 +03:00
|
|
|
|
|
|
|
XTENSA_SRC = $(SRC_PATH)/tests/tcg/xtensa
|
|
|
|
XTENSA_ALL = $(filter-out $(XTENSA_SRC)/linker.ld.S,$(wildcard $(XTENSA_SRC)/*.S))
|
|
|
|
XTENSA_TESTS = $(patsubst $(XTENSA_SRC)/%.S, %, $(XTENSA_ALL))
|
|
|
|
# Filter out common blobs and broken tests
|
2019-03-22 22:49:17 +03:00
|
|
|
XTENSA_BROKEN_TESTS = crt vectors
|
2018-12-06 20:12:44 +03:00
|
|
|
XTENSA_USABLE_TESTS = $(filter-out $(XTENSA_BROKEN_TESTS), $(XTENSA_TESTS))
|
|
|
|
|
|
|
|
# add to the list of tests
|
|
|
|
TESTS += $(XTENSA_USABLE_TESTS)
|
|
|
|
VPATH += $(XTENSA_SRC)
|
|
|
|
|
|
|
|
QEMU_OPTS+=-M sim -cpu $(CORE) -nographic -semihosting -icount 6 $(EXTFLAGS) -kernel
|
|
|
|
|
|
|
|
INCLUDE_DIRS = $(SRC_PATH)/target/xtensa/core-$(CORE)
|
|
|
|
XTENSA_INC = $(addprefix -I,$(INCLUDE_DIRS))
|
|
|
|
|
|
|
|
vectors_ASFLAGS = -mtext-section-literals
|
|
|
|
ASFLAGS = -Wa,--no-absolute-literals
|
|
|
|
LDFLAGS = -Tlinker.ld -nostartfiles -nostdlib
|
|
|
|
|
|
|
|
CRT = crt.o vectors.o
|
2023-03-15 00:52:19 +03:00
|
|
|
CLEANFILES += linker.ld
|
2018-12-06 20:12:44 +03:00
|
|
|
|
|
|
|
linker.ld: linker.ld.S
|
|
|
|
$(CC) $(XTENSA_INC) -E -P $< -o $@
|
|
|
|
|
|
|
|
$(XTENSA_USABLE_TESTS): linker.ld macros.inc $(CRT) Makefile.softmmu-target
|
|
|
|
|
|
|
|
# special rule for common blobs
|
|
|
|
%.o: %.S
|
2019-08-07 17:35:21 +03:00
|
|
|
$(CC) $(XTENSA_INC) $($*_ASFLAGS) $(ASFLAGS) $(EXTRA_CFLAGS) -c $< -o $@
|
2018-12-06 20:12:44 +03:00
|
|
|
|
|
|
|
%: %.S
|
2019-08-07 17:35:21 +03:00
|
|
|
$(CC) $(XTENSA_INC) $(ASFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS) $(NOSTDFLAGS) $(CRT)
|
2018-12-06 20:12:44 +03:00
|
|
|
|
|
|
|
endif
|
2023-04-24 12:22:44 +03:00
|
|
|
|
|
|
|
# We don't currently support the multiarch system tests
|
|
|
|
undefine MULTIARCH_TESTS
|