2018-06-05 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / setjmp-3.c
blob75222420811899db426145ff9650d275ba2367c8
1 /* { dg-do run } */
2 /* { dg-options "-O" } */
3 /* { dg-require-effective-target indirect_jumps } */
5 #include <setjmp.h>
7 extern void abort (void);
9 jmp_buf buf;
11 void raise0(void)
13 __builtin_longjmp (buf, 1);
16 int execute(int cmd)
18 int last = 0;
20 if (__builtin_setjmp (buf) == 0)
21 while (1)
23 last = 1;
24 raise0 ();
27 if (last == 0)
28 return 0;
29 else
30 return cmd;
33 int main(void)
35 if (execute (1) == 0)
36 abort ();
38 return 0;