]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.misc-tests/gcov-14.c
564b08eaa996024894e918515a09502e9d08cb51
[thirdparty/gcc.git] / gcc / testsuite / gcc.misc-tests / gcov-14.c
1 /* Test gcov extern inline. */
2
3 /* { dg-options "-O2 -fprofile-arcs -ftest-coverage" } */
4 /* The following line arranges that Darwin has behavior like elf weak import. */
5 /* { dg-additional-options "-flat_namespace -undefined suppress" { target *-*-darwin* } } */
6 /* { dg-require-weak "" } */
7 /* { dg-do run { target native } } */
8 /* { dg-skip-if "undefined weak not supported" { alpha*-dec-osf* } } */
9 /* { dg-skip-if "undefined weak not supported" { { hppa*-*-hpux* } && { ! lp64 } } } */
10
11 extern int __attribute__ ((weak)) Foo ();
12
13 extern __inline int Foo ()
14 {
15 return 0; /* count(-) */
16 }
17
18 int (* __attribute__ ((noinline)) Bar ()) ()
19 {
20 return Foo; /* count(1) */
21 }
22
23 int main ()
24 {
25 return Bar () != 0; /* count(1) */
26 }
27
28 /* { dg-final { run-gcov { -a gcov-14.c } } } */