tests/tcg/aarch64: Add bti smoke tests
[qemu.git] / tests / tcg / aarch64 / Makefile.target
1 # -*- Mode: makefile -*-
2 #
3 # AArch64 specific tweaks
4
5 ARM_SRC=$(SRC_PATH)/tests/tcg/arm
6 VPATH           += $(ARM_SRC)
7
8 AARCH64_SRC=$(SRC_PATH)/tests/tcg/aarch64
9 VPATH           += $(AARCH64_SRC)
10
11 # Float-convert Tests
12 AARCH64_TESTS=fcvt
13
14 fcvt: LDFLAGS+=-lm
15
16 run-fcvt: fcvt
17         $(call run-test,$<,$(QEMU) $<, "$< on $(TARGET_NAME)")
18         $(call diff-out,$<,$(AARCH64_SRC)/fcvt.ref)
19
20 # Pauth Tests
21 ifneq ($(DOCKER_IMAGE)$(CROSS_CC_HAS_ARMV8_3),)
22 AARCH64_TESTS += pauth-1 pauth-2 pauth-4 pauth-5
23 pauth-%: CFLAGS += -march=armv8.3-a
24 run-pauth-%: QEMU_OPTS += -cpu max
25 run-plugin-pauth-%: QEMU_OPTS += -cpu max
26 endif
27
28 # BTI Tests
29 # bti-1 tests the elf notes, so we require special compiler support.
30 ifneq ($(DOCKER_IMAGE)$(CROSS_CC_HAS_ARMV8_BTI),)
31 AARCH64_TESTS += bti-1
32 bti-1: CFLAGS += -mbranch-protection=standard
33 bti-1: LDFLAGS += -nostdlib
34 endif
35 # bti-2 tests PROT_BTI, so no special compiler support required.
36 AARCH64_TESTS += bti-2
37
38 # Semihosting smoke test for linux-user
39 AARCH64_TESTS += semihosting
40 run-semihosting: semihosting
41         $(call run-test,$<,$(QEMU) $< 2> $<.err, "$< on $(TARGET_NAME)")
42
43 run-plugin-semihosting-with-%:
44         $(call run-test, $@, $(QEMU) $(QEMU_OPTS) \
45                 -plugin $(PLUGIN_LIB)/$(call extract-plugin,$@) \
46                  $(call strip-plugin,$<) 2> $<.err, \
47                 "$< on $(TARGET_NAME) with $*")
48
49 AARCH64_TESTS += semiconsole
50 run-semiconsole: semiconsole
51         $(call skip-test, $<, "MANUAL ONLY")
52
53 run-plugin-semiconsole-with-%:
54         $(call skip-test, $<, "MANUAL ONLY")
55
56 ifneq ($(DOCKER_IMAGE)$(CROSS_CC_HAS_SVE),)
57 # System Registers Tests
58 AARCH64_TESTS += sysregs
59 sysregs: CFLAGS+=-march=armv8.1-a+sve
60
61 # SVE ioctl test
62 AARCH64_TESTS += sve-ioctls
63 sve-ioctls: CFLAGS+=-march=armv8.1-a+sve
64
65 ifneq ($(HAVE_GDB_BIN),)
66 GDB_SCRIPT=$(SRC_PATH)/tests/guest-debug/run-test.py
67
68 run-gdbstub-sysregs: sysregs
69         $(call run-test, $@, $(GDB_SCRIPT) \
70                 --gdb $(HAVE_GDB_BIN) \
71                 --qemu $(QEMU) --qargs "$(QEMU_OPTS)" \
72                 --bin $< --test $(AARCH64_SRC)/gdbstub/test-sve.py, \
73         "basic gdbstub SVE support")
74
75 run-gdbstub-sve-ioctls: sve-ioctls
76         $(call run-test, $@, $(GDB_SCRIPT) \
77                 --gdb $(HAVE_GDB_BIN) \
78                 --qemu $(QEMU) --qargs "$(QEMU_OPTS)" \
79                 --bin $< --test $(AARCH64_SRC)/gdbstub/test-sve-ioctl.py, \
80         "basic gdbstub SVE ZLEN support")
81
82 EXTRA_RUNS += run-gdbstub-sysregs run-gdbstub-sve-ioctls
83 endif
84
85 endif
86
87 TESTS += $(AARCH64_TESTS)