summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr84739.c
blob: 6903425c5c4769c956510e3510bf5ef20b21a9d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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 ();
}