gcc/testsuite/gcc.dg/ubsan/pr94423.c
raw| 1 | /* PR middle-end/94423 */ |
| 2 | /* { dg-do compile } */ |
| 3 | /* { dg-options "-O2 -fsanitize=object-size" } */ |
| 4 | |
| 5 | void foo (void); |
| 6 | typedef struct { long buf[22]; } jmp_buf[1]; |
| 7 | extern int sigsetjmp (jmp_buf, int) __attribute__ ((__nothrow__)); |
| 8 | jmp_buf buf; |
| 9 | |
| 10 | void |
| 11 | bar (int *c) |
| 12 | { |
| 13 | while (*c) |
| 14 | foo (); |
| 15 | while (*c) |
| 16 | sigsetjmp (buf, 0); |
| 17 | } |