diff options
Diffstat (limited to 'gcc/testsuite/gcc.misc-tests/gcov-14.c')
-rw-r--r-- | gcc/testsuite/gcc.misc-tests/gcov-14.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.misc-tests/gcov-14.c b/gcc/testsuite/gcc.misc-tests/gcov-14.c new file mode 100644 index 0000000..0eaf284 --- /dev/null +++ b/gcc/testsuite/gcc.misc-tests/gcov-14.c @@ -0,0 +1,24 @@ +/* Test gcov extern inline. */ + +/* { dg-options "-O2 -fprofile-arcs -ftest-coverage" } */ +/* { dg-require-weak "" } */ +/* { dg-do run { target native } } */ + +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 } } } */ |