diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2002-08-05 22:16:51 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2002-08-05 22:16:51 +0000 |
commit | d19202bab3d154185de0da52cf3856e00fe78cd6 (patch) | |
tree | 14ce17895d333e555a6871437542358a5ed0beac /gcc/gcov.c | |
parent | 1bed5ee327933809acc2bb4a95fdcf8254d7ffa5 (diff) | |
download | gcc-d19202bab3d154185de0da52cf3856e00fe78cd6.zip gcc-d19202bab3d154185de0da52cf3856e00fe78cd6.tar.gz gcc-d19202bab3d154185de0da52cf3856e00fe78cd6.tar.bz2 |
gcov.c (output_data): Round to % to nearest, tweak formatting.
gcc:
* gcov.c (output_data): Round to % to nearest, tweak formatting.
testsuite:
* lib/gcov.exp: Tweak expected line formats.
* gcc.misc-tests/gcov8.c: New test.
* gcc.misc-tests/gcov8.x: New flags.
From-SVN: r56059
Diffstat (limited to 'gcc/gcov.c')
-rw-r--r-- | gcc/gcov.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -1134,10 +1134,10 @@ format_hwint (top, bottom, dp) for (ix = dp; ix--; ) limit *= 10; - percent = (unsigned) (ratio * limit); - if (!percent && top) + percent = (unsigned) (ratio * limit + (float)0.5); + if (percent <= 0 && top) percent = 1; - else if (percent == limit && top != bottom) + else if (percent >= limit && top != bottom) percent = limit - 1; ix = sprintf (buffer, "%.*u%%", dp + 1, percent); if (dp) @@ -1607,10 +1607,10 @@ output_data () if (a_ptr->call_insn) { if (a_ptr->total == 0) - fnotice (gcov_file, "call %2d: never executed\n", i); + fnotice (gcov_file, "call %2d never executed\n", i); else fnotice - (gcov_file, "call %2d: returns %s\n", i, + (gcov_file, "call %2d returns %s\n", i, format_hwint (a_ptr->total - a_ptr->hits, a_ptr->total, -output_branch_counts)); @@ -1618,11 +1618,11 @@ output_data () else { if (a_ptr->total == 0) - fnotice (gcov_file, "branch %2d: never executed\n", + fnotice (gcov_file, "branch %2d never executed\n", i); else fnotice - (gcov_file, "branch %2d: taken %s\n", i, + (gcov_file, "branch %2d taken %s\n", i, format_hwint (a_ptr->hits, a_ptr->total, -output_branch_counts)); } |