summaryrefslogtreecommitdiff
path: root/gcc/gcov.c
diff options
context:
space:
mode:
authornathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2002-08-05 22:16:51 +0000
committernathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2002-08-05 22:16:51 +0000
commit21ff9ee870f32e8617ee1918381b64d0ffa82222 (patch)
tree14ce17895d333e555a6871437542358a5ed0beac /gcc/gcov.c
parent5a3fb4d355d4a39e8b85606aa7e7453121936225 (diff)
downloadgcc-21ff9ee870f32e8617ee1918381b64d0ffa82222.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@56059 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gcov.c')
-rw-r--r--gcc/gcov.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/gcc/gcov.c b/gcc/gcov.c
index 9925e95999b..e28aac076fc 100644
--- a/gcc/gcov.c
+++ b/gcc/gcov.c
@@ -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));
}