summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.misc-tests/gcov-5b.c
blob: cbd3958718ccc4758b19d894580f89cf270d4d0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/* Check that branch percentages are calculated in variables
   that are large enough to hold the count. */

/* { dg-options "-fprofile-arcs -ftest-coverage" } */
/* { dg-do run { target native } } */

#define LIMIT1 7000
#define LIMIT2 7000

int count;

void incr_count ()
{
  count++;
}

void doit (int i, int j)
{
  if (i > j)
    incr_count ();
}

int main ()
{
  int i, j;

  for (i = 0; i < LIMIT1; i++)
    for (j = 0; j < LIMIT2; j++)
      doit (i, j);

  return 0;
}

/* { dg-final { run-gcov branches { -b gcov-5b.c } } } */