aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.misc-tests/gcov-14.c
blob: de7ac0d2ab20d10c86bd6de9e73afc64f4dc70e5 (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
27
28
/* Test gcov extern inline.  */

/* { dg-options "-O2 -fprofile-arcs -ftest-coverage" } */
/* 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-do run { target native } } */
/* { 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 } } } */