OSDN Git Service

* gcc.dg/weak/typeof-2.c: Handle s390x targets as well.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.misc-tests / gcov-6.c
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.  */
5
6 /* { dg-options "-fprofile-arcs -ftest-coverage" } */
7 /* { dg-do run { target native } } */
8
9 int val;
10
11 void
12 foo (int i)
13 {
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) */
21 }
22
23 int
24 main()
25 {
26   int i;
27
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) */
35 }
36
37 /* { dg-final { run-gcov -b gcov-6.c } } */