1 /* Check that gcov correctly reports line counts, branch percentages,
2 * and call return percentages for functions that call longjmp. */
4 /* { dg-options "-fprofile-arcs -ftest-coverage" } */
5 /* { dg-do run { target native } } */
9 extern void abort (void);
10 extern void exit (int);
15 int bar_enter, bar_exit;
16 int foo_enter, foo_exit;
20 bar_enter++; /* count(3) */
24 longjmp_taken++; /* count(1) */
28 bar_exit++; /* count(2) */
33 foo_enter++; /* count(3) */
37 longjmp_taken++; /* count(1) */
41 bar (i); /* count(2) */
43 bar (7); /* count(1) */
46 foo_exit++; /* count(1) */
76 if ((retval = setjmp (env))) {
78 val += retval; /* count(2) */
81 foo (val); /* count(3) */
83 leave (passed()); /* count(1) */
87 /* { dg-final { run-gcov calls branches { -b gcov-7.c } } } */