OSDN Git Service

gcc/testsuite:
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.misc-tests / gcov-11.c
1 /* Test gcov block mode.  */
2
3 /* { dg-options "-fprofile-arcs -ftest-coverage" } */
4 /* { dg-do run { target native } } */
5
6 int one = 1; /* subvert constant folder. */
7 int zero = 0;
8
9 int foo (int ix)
10 {
11   return ix & 1 ? one : zero; /* count(10) */
12 }
13
14 int main ()
15 {
16   unsigned ix, jx = 0;
17   
18   for (ix = 10; ix--;) jx += foo (ix); /* count(11) */
19
20   return jx != 5;
21 }
22
23 /* { dg-final { run-gcov { -a gcov-11.c } } } */