gcc/testsuite/c-c++-common/musttail19.c
raw| 1 | /* { dg-do compile { target musttail } } */ |
| 2 | |
| 3 | float f1(void); |
| 4 | |
| 5 | int f2(void) |
| 6 | { |
| 7 | __attribute__((musttail)) return f1 (); /* { dg-error "changed after call" } */ |
| 8 | } |
| 9 | |
| 10 | |
| 11 | int f3(int *); |
| 12 | |
| 13 | int f4(int *p) |
| 14 | { |
| 15 | int x; |
| 16 | (void) p; |
| 17 | __attribute__((musttail)) return f3(&x); /* { dg-warning "address of automatic variable 'x' passed to 'musttail' call argument" } */ |
| 18 | } |