view gcc/testsuite/gcc.dg/pr84739.c @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 84e7813d76e9
children
line wrap: on
line source

/* 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 ();
}