Merge from trunk
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / pr60003.c
blob94d9cf886985ad7fba50987bfe34d862fe287b02
1 /* PR tree-optimization/60003 */
3 extern void abort (void);
5 unsigned long long jmp_buf[5];
7 __attribute__((noinline, noclone)) void
8 baz (void)
10 __builtin_longjmp (&jmp_buf, 1);
13 void
14 bar (void)
16 baz ();
19 __attribute__((noinline, noclone)) int
20 foo (int x)
22 int a = 0;
24 if (__builtin_setjmp (&jmp_buf) == 0)
26 while (1)
28 a = 1;
29 bar (); /* OK if baz () instead */
32 else
34 if (a == 0)
35 return 0;
36 else
37 return x;
41 int
42 main ()
44 if (foo (1) == 0)
45 abort ();
47 return 0;