1/* PR tree-optimization/60003 */
2/* { dg-require-effective-target indirect_jumps } */
3
4extern void abort (void);
5
6unsigned long long jmp_buf[5];
7
8__attribute__((noinline, noclone)) void
9baz (void)
10{
11  __builtin_longjmp (&jmp_buf, 1);
12}
13
14void
15bar (void)
16{
17  baz ();
18}
19
20__attribute__((noinline, noclone)) int
21foo (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
42int
43main ()
44{
45  if (foo (1) == 0)
46    abort ();
47
48  return 0;
49}
50