6 #define TEST(c, ...) ((c) ? 1 : (t_error(#c" failed: " __VA_ARGS__),0))
10 volatile int x = 0, r;
13 volatile sigset_t oldset;
20 TEST(x==1, "setjmp/longjmp seems to have been bypassed\n");
28 TEST(r==1, "longjmp(jb, 0) caused setjmp to return %d\n", r);
31 sigaddset(&set, SIGUSR1);
32 sigprocmask(SIG_UNBLOCK, &set, &set);
35 /* Improve the chances of catching failure of sigsetjmp to
36 * properly save the signal mask in the sigjmb_buf. */
37 memset(&sjb, -1, sizeof sjb);
39 if (!sigsetjmp(sjb, 1)) {
41 sigaddset(&set, SIGUSR1);
42 sigprocmask(SIG_BLOCK, &set, 0);
46 sigprocmask(SIG_SETMASK, &set, &set);
47 TEST(sigismember(&set, SIGUSR1)==0, "siglongjmp failed to restore mask\n");