| 1 |
/* Test gcov block mode. As the example does jump to a statement |
| 2 |
that is on a line with different ones, we must calculate such jump |
| 3 |
just once. */ |
| 4 |
|
| 5 |
/* { dg-options "-fprofile-arcs -ftest-coverage" } */ |
| 6 |
/* { dg-do run { target native } } */ |
| 7 |
|
| 8 |
int a = 0; |
| 9 |
|
| 10 |
void foo() /* count(1) */ |
| 11 |
{ |
| 12 |
a = 1; |
| 13 |
} |
| 14 |
|
| 15 |
void bar() /* count(1) */ |
| 16 |
{ |
| 17 |
a++; |
| 18 |
} |
| 19 |
|
| 20 |
int main() /* count(1) */ |
| 21 |
{ |
| 22 |
foo (); goto baz; lab: bar (); /* count(2) */ |
| 23 |
|
| 24 |
baz: |
| 25 |
if (a == 1) /* count(2) */ |
| 26 |
goto lab; /* count(1) */ |
| 27 |
} |
| 28 |
|
| 29 |
/* { dg-final { run-gcov { gcov-18.c } } } */ |