aboutsummaryrefslogtreecommitdiff
path: root/tests/tcg/s390x/ipm.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/tcg/s390x/ipm.c')
-rw-r--r--tests/tcg/s390x/ipm.c22
1 files changed, 22 insertions, 0 deletions
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;
+}