vhost-user: fix ioeventfd_enabled
[qemu/ar7.git] / tests / tcg / s390x / exrl-trt.c
blob3c5323aecb4780ce3b342579c9523c2e06fffbd1
1 #include <stdint.h>
2 #include <unistd.h>
4 int main(void)
6 char op1[] = "hello";
7 char op2[256];
8 uint64_t r1 = 0xffffffffffffffffull;
9 uint64_t r2 = 0xffffffffffffffffull;
10 uint64_t cc;
11 int i;
13 for (i = 0; i < 256; i++) {
14 if (i == 0) {
15 op2[i] = 0xaa;
16 } else {
17 op2[i] = 0;
20 asm volatile(
21 " j 2f\n"
22 "1: trt 0(1,%[op1]),0(%[op2])\n"
23 "2: exrl %[op1_len],1b\n"
24 " lgr %[r1],%%r1\n"
25 " lgr %[r2],%%r2\n"
26 " ipm %[cc]\n"
27 : [r1] "+r" (r1),
28 [r2] "+r" (r2),
29 [cc] "=r" (cc)
30 : [op1] "r" (&op1),
31 [op1_len] "r" (5),
32 [op2] "r" (&op2)
33 : "r1", "r2", "cc");
34 cc = (cc >> 28) & 3;
35 if (cc != 2) {
36 write(1, "bad cc\n", 7);
37 return 1;
39 if ((char *)r1 != &op1[5]) {
40 write(1, "bad r1\n", 7);
41 return 1;
43 if (r2 != 0xffffffffffffffaaull) {
44 write(1, "bad r2\n", 7);
45 return 1;
47 return 0;