master
target 87 lines 2.21 KB
Raw
1 # -*- Mode: makefile -*-
2 #
3 # ARM - included from tests/tcg/Makefile
4 #
5
6 ARM_SRC=$(SRC_PATH)/tests/tcg/arm
7
8 # Set search path for all sources
9 VPATH += $(ARM_SRC)
10
11 config-cc.mak: Makefile
12 $(quiet-@)( \
13 $(call cc-option,-fno-integrated-as, CROSS_CC_HAS_FNIA)) 3> config-cc.mak
14 -include config-cc.mak
15
16 float_madds: CFLAGS+=-mfpu=neon-vfpv4
17
18 # Basic Hello World
19 ARM_TESTS = hello-arm
20 hello-arm: CFLAGS+=-marm -ffreestanding -fno-stack-protector
21 hello-arm: LDFLAGS+=-nostdlib
22
23 # Float-convert Tests
24 ARM_TESTS += fcvt
25 fcvt: LDFLAGS += -lm
26 fcvt: CFLAGS += -march=armv8.2-a+fp16 -mfpu=neon-fp-armv8
27 run-fcvt: fcvt
28 $(call run-test,fcvt,$(QEMU) $<)
29 $(call diff-out,fcvt,$(ARM_SRC)/fcvt.ref)
30
31 # PC alignment test
32 ARM_TESTS += pcalign-a32
33 pcalign-a32: CFLAGS+=-marm
34
35 ifeq ($(CONFIG_ARM_COMPATIBLE_SEMIHOSTING),y)
36
37 # Semihosting smoke test for linux-user
38 semihosting: CFLAGS += -mthumb
39
40 ARM_TESTS += semihosting-arm
41 semihosting-arm: CFLAGS += -marm -I$(SRC_PATH)/tests/tcg/$(TARGET_NAME)
42 semihosting-arm: semihosting.c
43 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
44
45 run-semihosting-arm: semihosting-arm
46 $(call run-test,$<,$(QEMU) $< 2> $<.err)
47
48 ARM_TESTS += semiconsole-arm
49
50 semiconsole: CFLAGS += -mthumb
51
52 semiconsole-arm: CFLAGS += -marm -I$(SRC_PATH)/tests/tcg/$(TARGET_NAME)
53 semiconsole-arm: semihosting.c
54 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
55
56 run-semiconsole-arm: semiconsole-arm
57 $(call skip-test, $<, "MANUAL ONLY")
58
59 endif
60
61 ARM_TESTS += commpage
62
63 # Vector SHA1
64 # Work around compiler false-positive warning, as we do for the 'sha1' test
65 sha1-vector: CFLAGS=-O3 -Wno-stringop-overread
66 sha1-vector: sha1.c
67 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
68 run-sha1-vector: sha1-vector run-sha1
69 $(call run-test, $<, $(QEMU) $(QEMU_OPTS) $<)
70 $(call diff-out, sha1-vector, sha1.out)
71
72 ARM_TESTS += sha1-vector
73
74 # Vector versions of sha512 (-O3 triggers vectorisation)
75 sha512-vector: CFLAGS=-O3
76 sha512-vector: sha512.c
77 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
78
79 ARM_TESTS += sha512-vector
80
81 ifeq ($(CONFIG_PLUGIN),y)
82 # Require emitting arm32 instructions, otherwise the vCPU might accidentally
83 # try to execute Thumb instructions in arm32 mode after qemu_plugin_set_pc()
84 test-plugin-set-pc: CFLAGS+=-marm
85 endif
86
87 TESTS += $(ARM_TESTS)