diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/pr84739.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/pr84739.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr84739.c b/gcc/testsuite/gcc.dg/pr84739.c new file mode 100644 index 00000000000..6903425c5c4 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr84739.c @@ -0,0 +1,26 @@ +/* PR tree-optimization/84739 */ +/* { dg-do compile } */ +/* { dg-require-weak "" } */ +/* { dg-options "-O2" } */ + +static void baz (void) __attribute__((weakref("bar"))); /* { dg-warning "alias between functions of incompatible types" } */ + +int +foo (int x, int y) +{ + if (x) + y = 0; + if (y) + goto lab; + y = 0; +lab: + return y; +} + +void +bar (int x, int y) /* { dg-message "aliased declaration here" } */ +{ + y = foo (x, y); + if (y != 0) + baz (); +} |