view gcc/testsuite/gcc.misc-tests/gcov-14.c @ 138:fc828634a951

merge
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Thu, 08 Nov 2018 14:17:14 +0900
parents 04ced10e8804
children
line wrap: on
line source

/* Test gcov extern inline.  */

/* { dg-do run { target native } } */
/* { dg-options "-O2 -fprofile-arcs -ftest-coverage -fgnu89-inline" } */
/* The following line arranges that Darwin has behavior like elf weak import.  */
/* { dg-additional-options "-flat_namespace -undefined suppress" { target *-*-darwin* }  } */
/* { dg-require-weak "" } */
/* { dg-skip-if "undefined weak not supported" { { hppa*-*-hpux* } && { ! lp64 } } } */
/* { dg-skip-if "undefined weak not supported" { powerpc-ibm-aix* } } */

extern int __attribute__ ((weak)) Foo ();

extern __inline int Foo ()
{
  return 0; /* count(-) */
}

int (* __attribute__ ((noinline)) Bar ()) ()
{
  return Foo; /* count(1) */
}

int main ()
{
  return Bar () != 0; /* count(1) */
}

/* { dg-final { run-gcov { -a gcov-14.c } } } */