view gcc/testsuite/g++.dg/ipa/ipa-icf-5.C @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
line wrap: on
line source

/* { dg-do compile } */
/* { dg-require-visibility "" } */
/* { dg-require-alias "" } */
/* { dg-options "-O2 -fdump-ipa-icf" } */

struct test
{
  int a;
  float b;
};

extern const struct test myarray __attribute__ ((visibility("hidden")));
extern const struct test myarray_alias __attribute__ ((visibility("hidden")));

const struct test myarray = {1, 1.5f};

extern const struct test myarray_alias __attribute__ ((alias ("myarray")));

int main()
{
  return myarray.a - myarray_alias.a;
}

/* { dg-final { scan-ipa-dump "Equal symbols: 0" "icf"  } } */