PR tree-optimization/83369 - Missing diagnostics during inlining
[official-gcc.git] / gcc / testsuite / gcc.dg / non-local-goto-2.c
blobaa8d63a27c5f18ab402efab6cc105ff8cf40b58a
1 /* { dg-do run } */
2 /* { dg-options "-O2" } */
3 /* { dg-require-effective-target nonlocal_goto } */
5 extern void abort (void);
7 int global;
9 static int foo(void) __attribute__((noinline));
11 static int foo(void)
13 global = 1;
16 static int bar(void)
18 foo ();
19 global = 0;
22 int execute(int cmd)
24 __label__ start;
26 void raise(void)
28 goto start;
31 int last;
33 bar ();
35 last = 0;
37 start:
39 if (last == 0)
40 while (1)
42 last = 1;
43 raise ();
46 if (last == 0)
47 return 0;
48 else
49 return cmd;
52 int main(void)
54 if (execute (1) == 0)
55 abort ();
57 return 0;