Verify that s390x-specific uc_mcontext.psw.addr is reported correctly
and that signal handling interacts properly with debugging.
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
---
tests/tcg/s390x/Makefile.target | 18 +-
tests/tcg/s390x/gdbstub/test-signals-s390x.py | 76 ++++++++
tests/tcg/s390x/signals-s390x.c | 165 ++++++++++++++++++
3 files changed, 258 insertions(+), 1 deletion(-)
create mode 100644 tests/tcg/s390x/gdbstub/test-signals-s390x.py
create mode 100644 tests/tcg/s390x/signals-s390x.c
diff --git a/tests/tcg/s390x/Makefile.target b/tests/tcg/s390x/Makefile.target
index 0036b8a505..0a5b25c156 100644
--- a/tests/tcg/s390x/Makefile.target
+++ b/tests/tcg/s390x/Makefile.target
@@ -1,4 +1,5 @@
-VPATH+=$(SRC_PATH)/tests/tcg/s390x
+S390X_SRC=$(SRC_PATH)/tests/tcg/s390x
+VPATH+=$(S390X_SRC)
CFLAGS+=-march=zEC12 -m64
TESTS+=hello-s390x
TESTS+=csst
@@ -12,3 +13,18 @@ TESTS+=mvc
# This triggers failures on s390x hosts about 4% of the time
run-signals: signals
$(call skip-test, $<, "BROKEN awaiting sigframe clean-ups")
+
+TESTS+=signals-s390x
+
+ifneq ($(HAVE_GDB_BIN),)
+GDB_SCRIPT=$(SRC_PATH)/tests/guest-debug/run-test.py
+
+run-gdbstub-signals-s390x: signals-s390x
+ $(call run-test, $@, $(GDB_SCRIPT) \
+ --gdb $(HAVE_GDB_BIN) \
+ --qemu $(QEMU) --qargs "$(QEMU_OPTS)" \
+ --bin $< --test $(S390X_SRC)/gdbstub/test-signals-s390x.py, \
+ "mixing signals and debugging on s390x")
+
+EXTRA_RUNS += run-gdbstub-signals-s390x
+endif