diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2003-04-06 13:18:41 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2003-04-06 13:18:41 +0000 |
commit | 10b7602f3fcd1e5aac1d07e32b0c7c3c4d60426d (patch) | |
tree | a6fbf3af5cdd76991bee5fa0747e84b86b53a463 /gcc/testsuite/gcc.misc-tests/gcov-11.c | |
parent | 910c46b516b50e2ca38ade41c44c0f4194c1392e (diff) | |
download | gcc-10b7602f3fcd1e5aac1d07e32b0c7c3c4d60426d.zip gcc-10b7602f3fcd1e5aac1d07e32b0c7c3c4d60426d.tar.gz gcc-10b7602f3fcd1e5aac1d07e32b0c7c3c4d60426d.tar.bz2 |
gcov.c (struct arc_info): Replace local_span with cycle.
. * gcov.c (struct arc_info): Replace local_span with cycle.
(struct block_info): Replace u.span with u.cycle. Add is_call_return.
(solve_flow_graph): Set is_call_return.
(add_line_counts): Adjust. In block mode, blocks attach to last line.
(accumulate_line_counts): Find graph cycles, not spanning tree.
(output_branch_count): Adjust.
(output_lines): Adjust.
* doc/gcov.texi: Update.
testsuite:
* gcc.misc-test/gcov-9.c: New test.
* gcc.misc-test/gcov-10.c: New test
* gcc.misc-test/gcov-11.c: New test.
From-SVN: r65299
Diffstat (limited to 'gcc/testsuite/gcc.misc-tests/gcov-11.c')
-rw-r--r-- | gcc/testsuite/gcc.misc-tests/gcov-11.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.misc-tests/gcov-11.c b/gcc/testsuite/gcc.misc-tests/gcov-11.c new file mode 100644 index 0000000..a1037a5 --- /dev/null +++ b/gcc/testsuite/gcc.misc-tests/gcov-11.c @@ -0,0 +1,23 @@ +/* Test gcov block mode. */ + +/* { dg-options "-fprofile-arcs -ftest-coverage" } */ +/* { dg-do run { target native } } */ + +int one = 1; /* subvert constant folder. */ +int zero = 0; + +int foo (int ix) +{ + return ix & 1 ? one : zero; /* count(10) */ +} + +int main () +{ + unsigned ix, jx = 0; + + for (ix = 10; ix--;) jx += foo (ix); /* count(11) */ + + return jx != 5; +} + +/* { dg-final { run-gcov { -a gcov-11.c } } } */ |