1 /* Basic test to make sure doing a longjmp to a jmpbuf with an invalid sp
2 is caught by the fortification code. */
14 static int do_test(void);
15 #define TEST_FUNCTION do_test ()
16 #include "../test-skeleton.c"
23 __attribute__ ((noinline
))
27 asm volatile ("" : "=m" (buf
));
31 puts ("second longjmp succeeded");
37 static bool expected_to_fail
;
47 static const char msg
[] = "unexpected longjmp failure\n";
48 TEMP_FAILURE_RETRY (write (STDOUT_FILENO
, msg
, sizeof (msg
) - 1));
57 set_fortify_handler (handler
);
60 expected_to_fail
= false;
66 printf ("first longjmp returned\n");
71 expected_to_fail
= true;
76 puts ("second longjmp returned");