2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / gcc.misc-tests / gcov-6.c
blob90273d56396b81c9a3a394b5486435580cb0f1e6
1 /* Check that call return percentages are reported correctly by gcov,
2 along with line counts and branch percentages. This test case is
3 meant to be simple, as it was added at the same time that checking
4 for call return percentages was added. */
6 /* { dg-options "-fprofile-arcs -ftest-coverage" } */
7 /* { dg-do run { target native } } */
9 int val;
11 void
12 foo (int i)
14 /* branch(80) */
15 if (i < 0) /* count(5) */
16 /* branch(end) */
17 /* returns(0) */
18 exit (0); /* count(1) */
19 /* returns(end) */
20 val += i; /* count(4) */
23 int
24 main()
26 int i;
28 /* returns(100) */
29 foo (100); /* count(1) */
30 /* returns(end) */
31 for (i = 2; i > -10; i--)
32 /* returns(75) */
33 foo (i); /* count(4) */
34 /* returns(end) */
37 /* { dg-final { run-gcov branches calls { -b gcov-6.c } } } */