xref: /openbmc/qemu/tests/tcg/s390x/mvo.c (revision 7d87775f)
1 #include <stdint.h>
2 #include <stdio.h>
3 
4 int main(void)
5 {
6     uint8_t dest[6] = {0xff, 0x77, 0x88, 0x99, 0x0c, 0xff};
7     uint8_t src[5] = {0xee, 0x12, 0x34, 0x56, 0xee};
8     uint8_t expected[6] = {0xff, 0x01, 0x23, 0x45, 0x6c, 0xff};
9     int i;
10 
11     asm volatile (
12         "    mvo 0(4,%[dest]),0(3,%[src])\n"
13         :
14         : [dest] "a" (dest + 1),
15           [src] "a" (src + 1)
16         : "memory");
17 
18     for (i = 0; i < sizeof(expected); i++) {
19         if (dest[i] != expected[i]) {
20             fprintf(stderr, "bad data\n");
21             return 1;
22         }
23     }
24     return 0;
25 }
26