FreeBSD: add file descriptor tracking for _umtx_op
[valgrind.git] / none / tests / s390x / mvst.c
blobd2144417ebddd292310270355f64aad1b349bf44
1 #include "test.h"
3 char buffer[23] ="0123456789abcdef\0XXXXX";
4 char bigbuf[512]=
5 "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
6 "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
7 "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
8 "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
9 "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
10 "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
11 "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
12 "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcde\0";
14 char target[512];
16 int mvst(void *targetp, void *source)
18 register int eos asm("0") = '\0';
19 asm volatile(
20 " mvst %0, %1\n"
21 : "+a"(targetp), "+a"(source) : "d"(eos) : "memory", "cc");
22 return get_cc();
25 int mvst_full(void *targetp, void *source)
27 register int eos asm("0") = '\0';
28 asm volatile(
29 "0: mvst %0, %1\n"
30 " jo 0b\n"
31 : "+a"(targetp), "+a"(source) : "d"(eos) : "memory", "cc");
32 return get_cc();
36 int main()
38 short t;
39 char s;
40 printf("CC:%d\n", mvst(target, buffer));
41 printf("%s\n", target);
42 printf("CC:%d\n",mvst_full(target, bigbuf));
43 printf("%s\n", target);
44 t = 0x6161;
45 s = 0;
46 printf("%s\n", (char *) &t);
47 printf("CC:%d\n",mvst(&t,&s));
48 printf("%s\n", (char *) &t);
49 return 0;