2018-04-05 17:03:22 +03:00
|
|
|
# -*- Mode: makefile -*-
|
|
|
|
#
|
|
|
|
# Multiarch Tests - included from tests/tcg/Makefile.target
|
|
|
|
#
|
|
|
|
# These tests are plain C and built without any architecture specific code.
|
|
|
|
#
|
|
|
|
|
|
|
|
MULTIARCH_SRC=$(SRC_PATH)/tests/tcg/multiarch
|
|
|
|
|
|
|
|
# Set search path for all sources
|
2021-09-17 19:23:24 +03:00
|
|
|
VPATH += $(MULTIARCH_SRC)
|
|
|
|
MULTIARCH_SRCS = $(notdir $(wildcard $(MULTIARCH_SRC)/*.c))
|
2022-04-19 12:10:08 +03:00
|
|
|
ifeq ($(filter %-linux-user, $(TARGET)),$(TARGET))
|
2021-09-17 19:23:24 +03:00
|
|
|
VPATH += $(MULTIARCH_SRC)/linux
|
|
|
|
MULTIARCH_SRCS += $(notdir $(wildcard $(MULTIARCH_SRC)/linux/*.c))
|
|
|
|
endif
|
|
|
|
MULTIARCH_TESTS = $(MULTIARCH_SRCS:.c=)
|
|
|
|
|
2018-04-05 17:03:22 +03:00
|
|
|
#
|
|
|
|
# The following are any additional rules needed to build things
|
|
|
|
#
|
|
|
|
|
2019-09-13 14:12:17 +03:00
|
|
|
|
2019-09-16 16:50:56 +03:00
|
|
|
float_%: LDFLAGS+=-lm
|
2021-09-17 19:23:24 +03:00
|
|
|
float_%: float_%.c libs/float_helpers.c
|
|
|
|
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< $(MULTIARCH_SRC)/libs/float_helpers.c -o $@ $(LDFLAGS)
|
2019-09-13 14:12:17 +03:00
|
|
|
|
2019-09-16 16:50:56 +03:00
|
|
|
run-float_%: float_%
|
2022-09-29 14:42:03 +03:00
|
|
|
$(call run-test,$<, $(QEMU) $(QEMU_OPTS) $<)
|
2019-09-13 14:12:17 +03:00
|
|
|
$(call conditional-diff-out,$<,$(SRC_PATH)/tests/tcg/$(TARGET_NAME)/$<.ref)
|
|
|
|
|
|
|
|
|
2018-04-05 17:03:22 +03:00
|
|
|
testthread: LDFLAGS+=-lpthread
|
|
|
|
|
2020-05-20 17:05:40 +03:00
|
|
|
threadcount: LDFLAGS+=-lpthread
|
|
|
|
|
2021-05-27 19:03:14 +03:00
|
|
|
signals: LDFLAGS+=-lrt -lpthread
|
|
|
|
|
2022-10-28 15:42:27 +03:00
|
|
|
munmap-pthread: CFLAGS+=-pthread
|
|
|
|
munmap-pthread: LDFLAGS+=-pthread
|
|
|
|
|
2018-04-05 17:03:22 +03:00
|
|
|
# We define the runner for test-mmap after the individual
|
|
|
|
# architectures have defined their supported pages sizes. If no
|
|
|
|
# additional page sizes are defined we only run the default test.
|
|
|
|
|
|
|
|
# default case (host page size)
|
|
|
|
run-test-mmap: test-mmap
|
2022-09-29 14:42:03 +03:00
|
|
|
$(call run-test, test-mmap, $(QEMU) $<, $< (default))
|
2018-04-05 17:03:22 +03:00
|
|
|
|
|
|
|
# additional page sizes (defined by each architecture adding to EXTRA_RUNS)
|
|
|
|
run-test-mmap-%: test-mmap
|
2022-09-29 14:42:03 +03:00
|
|
|
$(call run-test, test-mmap-$*, $(QEMU) -p $* $<, $< ($* byte pages))
|
2019-09-16 12:24:05 +03:00
|
|
|
|
2020-04-30 22:01:21 +03:00
|
|
|
ifneq ($(HAVE_GDB_BIN),)
|
|
|
|
GDB_SCRIPT=$(SRC_PATH)/tests/guest-debug/run-test.py
|
|
|
|
|
|
|
|
run-gdbstub-sha1: sha1
|
|
|
|
$(call run-test, $@, $(GDB_SCRIPT) \
|
|
|
|
--gdb $(HAVE_GDB_BIN) \
|
|
|
|
--qemu $(QEMU) --qargs "$(QEMU_OPTS)" \
|
|
|
|
--bin $< --test $(MULTIARCH_SRC)/gdbstub/sha1.py, \
|
2022-09-29 14:42:03 +03:00
|
|
|
basic gdbstub support)
|
2020-04-30 22:01:21 +03:00
|
|
|
|
2021-01-09 01:42:42 +03:00
|
|
|
run-gdbstub-qxfer-auxv-read: sha1
|
|
|
|
$(call run-test, $@, $(GDB_SCRIPT) \
|
|
|
|
--gdb $(HAVE_GDB_BIN) \
|
|
|
|
--qemu $(QEMU) --qargs "$(QEMU_OPTS)" \
|
|
|
|
--bin $< --test $(MULTIARCH_SRC)/gdbstub/test-qxfer-auxv-read.py, \
|
2022-09-29 14:42:03 +03:00
|
|
|
basic gdbstub qXfer:auxv:read support)
|
2021-01-09 01:42:42 +03:00
|
|
|
|
2021-10-26 13:22:34 +03:00
|
|
|
run-gdbstub-thread-breakpoint: testthread
|
|
|
|
$(call run-test, $@, $(GDB_SCRIPT) \
|
|
|
|
--gdb $(HAVE_GDB_BIN) \
|
|
|
|
--qemu $(QEMU) --qargs "$(QEMU_OPTS)" \
|
|
|
|
--bin $< --test $(MULTIARCH_SRC)/gdbstub/test-thread-breakpoint.py, \
|
2022-09-29 14:42:03 +03:00
|
|
|
hitting a breakpoint on non-main thread)
|
2021-10-26 13:22:34 +03:00
|
|
|
|
2021-02-02 16:39:54 +03:00
|
|
|
else
|
|
|
|
run-gdbstub-%:
|
|
|
|
$(call skip-test, "gdbstub test $*", "need working gdb")
|
2020-04-30 22:01:21 +03:00
|
|
|
endif
|
2021-10-26 13:22:34 +03:00
|
|
|
EXTRA_RUNS += run-gdbstub-sha1 run-gdbstub-qxfer-auxv-read \
|
|
|
|
run-gdbstub-thread-breakpoint
|
2020-04-30 22:01:21 +03:00
|
|
|
|
2021-03-23 19:52:51 +03:00
|
|
|
# ARM Compatible Semi Hosting Tests
|
|
|
|
#
|
|
|
|
# Despite having ARM in the name we actually have several
|
|
|
|
# architectures that implement it. We gate the tests on the feature
|
|
|
|
# appearing in config.
|
|
|
|
#
|
|
|
|
ifeq ($(CONFIG_ARM_COMPATIBLE_SEMIHOSTING),y)
|
|
|
|
VPATH += $(MULTIARCH_SRC)/arm-compat-semi
|
|
|
|
|
|
|
|
# Add -I path back to TARGET_NAME for semicall.h
|
|
|
|
semihosting: CFLAGS+=-I$(SRC_PATH)/tests/tcg/$(TARGET_NAME)
|
|
|
|
|
|
|
|
run-semihosting: semihosting
|
2022-09-29 14:42:03 +03:00
|
|
|
$(call run-test,$<,$(QEMU) $< 2> $<.err)
|
2021-03-23 19:52:51 +03:00
|
|
|
|
|
|
|
run-plugin-semihosting-with-%:
|
|
|
|
$(call run-test, $@, $(QEMU) $(QEMU_OPTS) \
|
|
|
|
-plugin $(PLUGIN_LIB)/$(call extract-plugin,$@) \
|
|
|
|
$(call strip-plugin,$<) 2> $<.err, \
|
2022-09-29 14:42:03 +03:00
|
|
|
$< with $*)
|
2021-03-23 19:52:51 +03:00
|
|
|
|
|
|
|
semiconsole: CFLAGS+=-I$(SRC_PATH)/tests/tcg/$(TARGET_NAME)
|
|
|
|
|
|
|
|
run-semiconsole: semiconsole
|
|
|
|
$(call skip-test, $<, "MANUAL ONLY")
|
|
|
|
|
|
|
|
run-plugin-semiconsole-with-%:
|
|
|
|
$(call skip-test, $<, "MANUAL ONLY")
|
|
|
|
|
|
|
|
TESTS += semihosting semiconsole
|
|
|
|
endif
|
2020-04-30 22:01:21 +03:00
|
|
|
|
2019-09-16 12:24:05 +03:00
|
|
|
# Update TESTS
|
|
|
|
TESTS += $(MULTIARCH_TESTS)
|