gcc/testsuite/c-c++-common/asan/pr121389-1.c
raw| 1 | // PR middle-end/121389 |
| 2 | // { dg-do compile { target musttail } } |
| 3 | // { dg-options "-fsanitize=address" } |
| 4 | |
| 5 | int foo (void); |
| 6 | int bar (void); |
| 7 | int baz (unsigned *); |
| 8 | |
| 9 | int |
| 10 | bar (void) |
| 11 | { |
| 12 | do |
| 13 | { |
| 14 | unsigned t; |
| 15 | int u = baz (&t); |
| 16 | if (u == 42) |
| 17 | [[gnu::musttail]] return foo (); |
| 18 | if (u == -42) |
| 19 | break; |
| 20 | } |
| 21 | while (1); |
| 22 | return 42; |
| 23 | } |