gcov-14.c 795 B

1234567891011121314151617181920212223242526272829
  1. /* Test gcov extern inline. */
  2. /* { dg-options "-O2 -fprofile-arcs -ftest-coverage -fgnu89-inline" } */
  3. /* The following line arranges that Darwin has behavior like elf weak import. */
  4. /* { dg-additional-options "-flat_namespace -undefined suppress" { target *-*-darwin* } } */
  5. /* { dg-require-weak "" } */
  6. /* { dg-do run { target native } } */
  7. /* { dg-skip-if "undefined weak not supported" { { hppa*-*-hpux* } && { ! lp64 } } } */
  8. /* { dg-skip-if "undefined weak not supported" { powerpc-ibm-aix* } } */
  9. extern int __attribute__ ((weak)) Foo ();
  10. extern __inline int Foo ()
  11. {
  12. return 0; /* count(-) */
  13. }
  14. int (* __attribute__ ((noinline)) Bar ()) ()
  15. {
  16. return Foo; /* count(1) */
  17. }
  18. int main ()
  19. {
  20. return Bar () != 0; /* count(1) */
  21. }
  22. /* { dg-final { run-gcov { -a gcov-14.c } } } */