Merge remote-tracking branch 'remotes/dg-gitlab/tags/cgs-pull-request' into staging
[qemu/ar7.git] / tests / tcg / s390x / pack.c
blob4be36f29a74042294d7d69aeb313f3e8bd87665e
1 #include <unistd.h>
3 int main(void)
5 char data[] = {0xaa, 0xaa, 0xf1, 0xf2, 0xf3, 0xc4, 0xaa, 0xaa};
6 char exp[] = {0xaa, 0xaa, 0x00, 0x01, 0x23, 0x4c, 0xaa, 0xaa};
7 int i;
9 asm volatile(
10 " pack 2(4,%[data]),2(4,%[data])\n"
12 : [data] "r" (&data[0])
13 : "memory");
14 for (i = 0; i < 8; i++) {
15 if (data[i] != exp[i]) {
16 write(1, "bad data\n", 9);
17 return 1;
20 return 0;