1 /* PR tree-optimization/60003 */
2 /* { dg-require-effective-target indirect_jumps } */
3 
4 extern void abort (void);
5 
6 unsigned long long jmp_buf[5];
7 
8 __attribute__((noinline, noclone)) void
baz(void)9 baz (void)
10 {
11   __builtin_longjmp (&jmp_buf, 1);
12 }
13 
14 void
bar(void)15 bar (void)
16 {
17   baz ();
18 }
19 
20 __attribute__((noinline, noclone)) int
foo(int x)21 foo (int x)
22 {
23   int a = 0;
24 
25   if (__builtin_setjmp (&jmp_buf) == 0)
26     {
27       while (1)
28 	{
29 	  a = 1;
30 	  bar ();  /* OK if baz () instead */
31 	}
32     }
33   else
34     {
35       if (a == 0)
36 	return 0;
37       else
38 	return x;
39     }
40 }
41 
42 int
main()43 main ()
44 {
45   if (foo (1) == 0)
46     abort ();
47 
48   return 0;
49 }
50