Merge tag 'pull-loongarch-20221122' of https://gitlab.com/gaosong/qemu into staging
[qemu/ar7.git] / tests / tcg / aarch64 / Makefile.target
blobfc8d90ed69227250fae098fc7c486a96bf65c3cc
1 # -*- Mode: makefile -*-
3 # AArch64 specific tweaks
5 ARM_SRC=$(SRC_PATH)/tests/tcg/arm
6 VPATH           += $(ARM_SRC)
8 AARCH64_SRC=$(SRC_PATH)/tests/tcg/aarch64
9 VPATH           += $(AARCH64_SRC)
11 # Base architecture tests
12 AARCH64_TESTS=fcvt pcalign-a64
14 fcvt: LDFLAGS+=-lm
16 run-fcvt: fcvt
17         $(call run-test,$<,$(QEMU) $<, "$< on $(TARGET_NAME)")
18         $(call diff-out,$<,$(AARCH64_SRC)/fcvt.ref)
20 config-cc.mak: Makefile
21         $(quiet-@)( \
22             $(call cc-option,-march=armv8.1-a+sve,          CROSS_CC_HAS_SVE); \
23             $(call cc-option,-march=armv8.1-a+sve2,         CROSS_CC_HAS_SVE2); \
24             $(call cc-option,-march=armv8.3-a,              CROSS_CC_HAS_ARMV8_3); \
25             $(call cc-option,-mbranch-protection=standard,  CROSS_CC_HAS_ARMV8_BTI); \
26             $(call cc-option,-march=armv8.5-a+memtag,       CROSS_CC_HAS_ARMV8_MTE)) 3> config-cc.mak
27 -include config-cc.mak
29 # Pauth Tests
30 ifneq ($(CROSS_CC_HAS_ARMV8_3),)
31 AARCH64_TESTS += pauth-1 pauth-2 pauth-4 pauth-5
32 pauth-%: CFLAGS += -march=armv8.3-a
33 run-pauth-%: QEMU_OPTS += -cpu max
34 run-plugin-pauth-%: QEMU_OPTS += -cpu max
35 endif
37 # BTI Tests
38 # bti-1 tests the elf notes, so we require special compiler support.
39 ifneq ($(CROSS_CC_HAS_ARMV8_BTI),)
40 AARCH64_TESTS += bti-1 bti-3
41 bti-1 bti-3: CFLAGS += -mbranch-protection=standard
42 bti-1 bti-3: LDFLAGS += -nostdlib
43 endif
44 # bti-2 tests PROT_BTI, so no special compiler support required.
45 AARCH64_TESTS += bti-2
47 # MTE Tests
48 ifneq ($(CROSS_CC_HAS_ARMV8_MTE),)
49 AARCH64_TESTS += mte-1 mte-2 mte-3 mte-4 mte-5 mte-6 mte-7
50 mte-%: CFLAGS += -march=armv8.5-a+memtag
51 endif
53 ifneq ($(CROSS_CC_HAS_SVE),)
54 # System Registers Tests
55 AARCH64_TESTS += sysregs
56 sysregs: CFLAGS+=-march=armv8.1-a+sve
58 # SVE ioctl test
59 AARCH64_TESTS += sve-ioctls
60 sve-ioctls: CFLAGS+=-march=armv8.1-a+sve
62 # Vector SHA1
63 sha1-vector: CFLAGS=-O3
64 sha1-vector: sha1.c
65         $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
66 run-sha1-vector: sha1-vector run-sha1
67         $(call run-test, $<, $(QEMU) $(QEMU_OPTS) $<)
68         $(call diff-out, sha1-vector, sha1.out)
70 TESTS += sha1-vector
72 # Vector versions of sha512 (-O3 triggers vectorisation)
73 sha512-vector: CFLAGS=-O3
74 sha512-vector: sha512.c
75         $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
77 TESTS += sha512-vector
79 ifneq ($(HAVE_GDB_BIN),)
80 GDB_SCRIPT=$(SRC_PATH)/tests/guest-debug/run-test.py
82 run-gdbstub-sysregs: sysregs
83         $(call run-test, $@, $(GDB_SCRIPT) \
84                 --gdb $(HAVE_GDB_BIN) \
85                 --qemu $(QEMU) --qargs "$(QEMU_OPTS)" \
86                 --bin $< --test $(AARCH64_SRC)/gdbstub/test-sve.py, \
87         basic gdbstub SVE support)
89 run-gdbstub-sve-ioctls: sve-ioctls
90         $(call run-test, $@, $(GDB_SCRIPT) \
91                 --gdb $(HAVE_GDB_BIN) \
92                 --qemu $(QEMU) --qargs "$(QEMU_OPTS)" \
93                 --bin $< --test $(AARCH64_SRC)/gdbstub/test-sve-ioctl.py, \
94         basic gdbstub SVE ZLEN support)
96 EXTRA_RUNS += run-gdbstub-sysregs run-gdbstub-sve-ioctls
97 endif
98 endif
100 ifneq ($(CROSS_CC_HAS_SVE2),)
101 AARCH64_TESTS += test-826
102 test-826: CFLAGS+=-march=armv8.1-a+sve2
103 endif
105 TESTS += $(AARCH64_TESTS)