gcc/testsuite/gcc.dg/pr84739.c
raw| 1 | /* PR tree-optimization/84739 */ |
| 2 | /* { dg-do compile } */ |
| 3 | /* { dg-require-weak "" } */ |
| 4 | /* { dg-options "-O2" } */ |
| 5 | |
| 6 | static void baz (void) __attribute__((weakref("bar"))); /* { dg-warning "alias between functions of incompatible types" } */ |
| 7 | |
| 8 | int |
| 9 | foo (int x, int y) |
| 10 | { |
| 11 | if (x) |
| 12 | y = 0; |
| 13 | if (y) |
| 14 | goto lab; |
| 15 | y = 0; |
| 16 | lab: |
| 17 | return y; |
| 18 | } |
| 19 | |
| 20 | void |
| 21 | bar (int x, int y) /* { dg-message "aliased declaration here" } */ |
| 22 | { |
| 23 | y = foo (x, y); |
| 24 | if (y != 0) |
| 25 | baz (); |
| 26 | } |