gcc/testsuite/gcc.dg/torture/pr64728.c
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-require-effective-target nonlocal_goto } */ |
| 3 | |
| 4 | #include <setjmp.h> |
| 5 | |
| 6 | jmp_buf a; |
| 7 | int b, d; |
| 8 | void baz (long); |
| 9 | |
| 10 | static void |
| 11 | bar (long *x) |
| 12 | { |
| 13 | if (d) |
| 14 | *x = b; |
| 15 | } |
| 16 | |
| 17 | void |
| 18 | foo () |
| 19 | { |
| 20 | baz (0); |
| 21 | if (setjmp (a)) |
| 22 | { |
| 23 | long c; |
| 24 | bar (&c); |
| 25 | baz (c); |
| 26 | } |
| 27 | baz (0); |
| 28 | } |