1 /* PR target/100402 */
2 /* Testcase by Hannes Domani <ssbssa@yahoo.de> */
3 
4 /* { dg-require-effective-target indirect_jumps } */
5 
6 #include <setjmp.h>
7 #include <stdbool.h>
8 
9 static jmp_buf buf;
10 static _Bool stop = false;
11 
call_func(void (* func)(void))12 void call_func (void(*func)(void))
13 {
14   func ();
15 }
16 
func(void)17 void func (void)
18 {
19   stop = true;
20   longjmp (buf, 1);
21 }
22 
main(void)23 int main (void)
24 {
25   setjmp (buf);
26 
27   while (!stop)
28     call_func (func);
29 
30   return 0;
31 }
32