aboutsummaryrefslogtreecommitdiff
path: root/tests/tcg/s390x
diff options
context:
space:
mode:
Diffstat (limited to 'tests/tcg/s390x')
-rw-r--r--tests/tcg/s390x/Makefile.target1
-rw-r--r--tests/tcg/s390x/ipm.c22
2 files changed, 23 insertions, 0 deletions
diff --git a/tests/tcg/s390x/Makefile.target b/tests/tcg/s390x/Makefile.target
index f62f950d8e..c800a582e5 100644
--- a/tests/tcg/s390x/Makefile.target
+++ b/tests/tcg/s390x/Makefile.target
@@ -2,3 +2,4 @@ VPATH+=$(SRC_PATH)/tests/tcg/s390x
CFLAGS+=-march=zEC12 -m64
TESTS+=hello-s390x
TESTS+=csst
+TESTS+=ipm
diff --git a/tests/tcg/s390x/ipm.c b/tests/tcg/s390x/ipm.c
new file mode 100644
index 0000000000..742f3a18c5
--- /dev/null
+++ b/tests/tcg/s390x/ipm.c
@@ -0,0 +1,22 @@
+#include <stdint.h>
+#include <unistd.h>
+
+int main(void)
+{
+ uint32_t op1 = 0x55555555;
+ uint32_t op2 = 0x44444444;
+ uint64_t cc = 0xffffffffffffffffull;
+
+ asm volatile(
+ " clc 0(4,%[op1]),0(%[op2])\n"
+ " ipm %[cc]\n"
+ : [cc] "+r" (cc)
+ : [op1] "r" (&op1),
+ [op2] "r" (&op2)
+ : "cc");
+ if (cc != 0xffffffff20ffffffull) {
+ write(1, "bad cc\n", 7);
+ return 1;
+ }
+ return 0;
+}