FreeBSD: add file descriptor tracking for _umtx_op
[valgrind.git] / none / tests / s390x / ex_sig.c
blob9ff33fcd40640ba9e3ab948779d38611a672288d
1 #include <features.h>
2 #include <fpu_control.h>
3 #include <signal.h>
4 #include <sys/types.h>
5 #include <signal.h>
6 #include <stdio.h>
7 #include <stdlib.h>
8 #include <ucontext.h>
9 #include <unistd.h>
11 char source[40] = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\0";
12 char target[40] = " \0";
14 void handle_SIG(int sig)
16 static int counter;
17 char buf2[40];
19 counter++;
20 asm volatile( "larl 1,1f\n"
21 "ex 0,0(1)\n"
22 "j 2f\n"
23 "1: mvc 0(30,%0),0(%1)\n"
24 "2:\n"
25 ::"a" (buf2), "a" (source)
26 : "1");
27 if (counter == 2) {
28 printf("%s\n", target);
29 exit(1);
30 } else
31 alarm(1);
34 int main()
36 signal(SIGALRM, handle_SIG);
37 alarm(1);
39 asm volatile( "larl 1,1f\n"
40 "0: ex 0,0(1)\n"
41 "j 0b\n"
42 "1: mvc 0(20,%0),0(%1)\n"
43 ::"a" (target), "a" (source)
44 : "1");
45 exit(0);