gcc/testsuite/gcc.dg/torture/pr66101.c
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-require-effective-target nonlocal_goto } */ |
| 3 | |
| 4 | #include <setjmp.h> |
| 5 | |
| 6 | jmp_buf env; |
| 7 | |
| 8 | int a, c, d, e; |
| 9 | |
| 10 | int |
| 11 | bar () |
| 12 | { |
| 13 | int b = *(long *) 7 == 5 ? : 0; |
| 14 | if (a || a > b) |
| 15 | longjmp (env, 0); |
| 16 | return 1; |
| 17 | } |
| 18 | |
| 19 | void |
| 20 | foo () |
| 21 | { |
| 22 | long f; |
| 23 | setjmp (env); |
| 24 | for (; d; c++) |
| 25 | switch (c) |
| 26 | case 0: |
| 27 | { |
| 28 | f = bar () >> 1; |
| 29 | if (e) |
| 30 | goto L; |
| 31 | if (bar () >> 1) |
| 32 | goto L; |
| 33 | } |
| 34 | L: |
| 35 | ; |
| 36 | } |