xref: /openbmc/qemu/tests/tcg/arm/Makefile.target (revision b14df228)
1# -*- Mode: makefile -*-
2#
3# ARM - included from tests/tcg/Makefile
4#
5
6ARM_SRC=$(SRC_PATH)/tests/tcg/arm
7
8# Set search path for all sources
9VPATH 		+= $(ARM_SRC)
10
11float_madds: CFLAGS+=-mfpu=neon-vfpv4
12
13# Basic Hello World
14ARM_TESTS = hello-arm
15hello-arm: CFLAGS+=-marm -ffreestanding
16hello-arm: LDFLAGS+=-nostdlib
17
18# IWMXT floating point extensions
19ARM_TESTS += test-arm-iwmmxt
20test-arm-iwmmxt: CFLAGS+=-marm -march=iwmmxt -mabi=aapcs -mfpu=fpv4-sp-d16
21test-arm-iwmmxt: test-arm-iwmmxt.S
22	$(CC) $(CFLAGS) $< -o $@ $(LDFLAGS)
23
24# Float-convert Tests
25ARM_TESTS += fcvt
26fcvt: LDFLAGS+=-lm
27# fcvt: CFLAGS+=-march=armv8.2-a+fp16 -mfpu=neon-fp-armv8
28run-fcvt: fcvt
29	$(call run-test,fcvt,$(QEMU) $<,"$< on $(TARGET_NAME)")
30	$(call diff-out,fcvt,$(ARM_SRC)/fcvt.ref)
31
32# PC alignment test
33ARM_TESTS += pcalign-a32
34pcalign-a32: CFLAGS+=-marm
35
36ifeq ($(CONFIG_ARM_COMPATIBLE_SEMIHOSTING),y)
37
38# Semihosting smoke test for linux-user
39semihosting: CFLAGS += -mthumb
40
41ARM_TESTS += semihosting-arm
42semihosting-arm: CFLAGS += -marm -I$(SRC_PATH)/tests/tcg/$(TARGET_NAME)
43semihosting-arm: semihosting.c
44	$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
45
46run-semihosting-arm: semihosting-arm
47	$(call run-test,$<,$(QEMU) $< 2> $<.err, "$< on $(TARGET_NAME)")
48
49run-plugin-semihosting-arm-with-%:
50	$(call run-test, $@, $(QEMU) $(QEMU_OPTS) \
51		-plugin $(PLUGIN_LIB)/$(call extract-plugin,$@) \
52		 $(call strip-plugin,$<) 2> $<.err, \
53		"$< on $(TARGET_NAME) with $*")
54
55ARM_TESTS += semiconsole-arm
56
57semiconsole: CFLAGS += -mthumb
58
59semiconsole-arm: CFLAGS += -marm -I$(SRC_PATH)/tests/tcg/$(TARGET_NAME)
60semiconsole-arm: semihosting.c
61	$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
62
63run-semiconsole-arm: semiconsole-arm
64	$(call skip-test, $<, "MANUAL ONLY")
65
66run-plugin-semiconsole-arm-with-%:
67	$(call skip-test, $<, "MANUAL ONLY")
68
69endif
70
71ARM_TESTS += commpage
72
73# Vector SHA1
74sha1-vector: CFLAGS=-O3
75sha1-vector: sha1.c
76	$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
77run-sha1-vector: sha1-vector run-sha1
78	$(call run-test, $<, $(QEMU) $(QEMU_OPTS) $<, "$< on $(TARGET_NAME)")
79	$(call diff-out, sha1-vector, sha1.out)
80
81ARM_TESTS += sha1-vector
82
83# Vector versions of sha512 (-O3 triggers vectorisation)
84sha512-vector: CFLAGS=-O3
85sha512-vector: sha512.c
86	$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
87
88ARM_TESTS += sha512-vector
89
90TESTS += $(ARM_TESTS)
91
92# On ARM Linux only supports 4k pages
93EXTRA_RUNS+=run-test-mmap-4096
94