xref: /openbmc/qemu/tests/tcg/s390x/Makefile.target (revision 27047bd2)
1S390X_SRC=$(SRC_PATH)/tests/tcg/s390x
2VPATH+=$(S390X_SRC)
3CFLAGS+=-march=zEC12 -m64
4
5%.o: %.c
6	$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c $< -o $@
7
8config-cc.mak: Makefile
9	$(quiet-@)( \
10	    $(call cc-option,-march=z14, CROSS_CC_HAS_Z14); \
11	    $(call cc-option,-march=z15, CROSS_CC_HAS_Z15)) 3> config-cc.mak
12-include config-cc.mak
13
14TESTS+=hello-s390x
15TESTS+=csst
16TESTS+=ipm
17TESTS+=exrl-trt
18TESTS+=exrl-trtr
19TESTS+=pack
20TESTS+=mie3-compl
21TESTS+=mie3-mvcrl
22TESTS+=mie3-sel
23TESTS+=mvo
24TESTS+=mvc
25TESTS+=shift
26TESTS+=trap
27TESTS+=signals-s390x
28TESTS+=branch-relative-long
29TESTS+=noexec
30TESTS+=div
31TESTS+=clst
32TESTS+=long-double
33TESTS+=cdsg
34TESTS+=chrl
35TESTS+=rxsbg
36TESTS+=ex-relative-long
37TESTS+=ex-branch
38TESTS+=mxdb
39
40cdsg: CFLAGS+=-pthread
41cdsg: LDFLAGS+=-pthread
42
43rxsbg: CFLAGS+=-O2
44
45include $(S390X_SRC)/pgm-specification.mak
46$(PGM_SPECIFICATION_TESTS): pgm-specification-user.o
47$(PGM_SPECIFICATION_TESTS): LDFLAGS+=pgm-specification-user.o
48TESTS += $(PGM_SPECIFICATION_TESTS)
49
50Z13_TESTS=vistr
51Z13_TESTS+=lcbb
52Z13_TESTS+=locfhr
53$(Z13_TESTS): CFLAGS+=-march=z13 -O2
54TESTS+=$(Z13_TESTS)
55
56ifneq ($(CROSS_CC_HAS_Z14),)
57Z14_TESTS=vfminmax
58vfminmax: LDFLAGS+=-lm
59$(Z14_TESTS): CFLAGS+=-march=z14 -O2
60TESTS+=$(Z14_TESTS)
61endif
62
63ifneq ($(CROSS_CC_HAS_Z15),)
64Z15_TESTS=vxeh2_vs
65Z15_TESTS+=vxeh2_vcvt
66Z15_TESTS+=vxeh2_vlstr
67$(Z15_TESTS): CFLAGS+=-march=z15 -O2
68TESTS+=$(Z15_TESTS)
69endif
70
71ifeq ($(HOST_GDB_SUPPORTS_ARCH),y)
72GDB_SCRIPT=$(SRC_PATH)/tests/guest-debug/run-test.py
73
74run-gdbstub-signals-s390x: signals-s390x
75	$(call run-test, $@, $(GDB_SCRIPT) \
76		--gdb $(HAVE_GDB_BIN) \
77		--qemu $(QEMU) --qargs "$(QEMU_OPTS)" \
78		--bin $< --test $(S390X_SRC)/gdbstub/test-signals-s390x.py, \
79	mixing signals and debugging)
80
81hello-s390x-asm: CFLAGS+=-nostdlib
82
83run-gdbstub-svc: hello-s390x-asm
84	$(call run-test, $@, $(GDB_SCRIPT) \
85		--gdb $(HAVE_GDB_BIN) \
86		--qemu $(QEMU) --qargs "$(QEMU_OPTS)" \
87		--bin $< --test $(S390X_SRC)/gdbstub/test-svc.py, \
88	single-stepping svc)
89
90EXTRA_RUNS += run-gdbstub-signals-s390x run-gdbstub-svc
91endif
92
93# MVX versions of sha512
94sha512-mvx: CFLAGS=-march=z13 -mvx -O3
95sha512-mvx: sha512.c
96	$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
97
98TESTS+=sha512-mvx
99