Commit 4830cfc0 by Martin Liska Committed by Martin Liska

Fix timevar format and fix tests (PR testsuite/84597).

2018-02-28  Martin Liska  <mliska@suse.cz>

	PR testsuite/84597
	* timevar.c (timer::print): Fix format to properly print 100%
	values.
2018-02-28  Martin Liska  <mliska@suse.cz>

	PR testsuite/84597
	* g++.dg/ext/timevar1.C: Fix pruned patterns.
	* g++.dg/ext/timevar2.C: Likewise.

From-SVN: r258063
parent 095d8d4b
2018-02-28 Martin Liska <mliska@suse.cz>
PR testsuite/84597
* timevar.c (timer::print): Fix format to properly print 100%
values.
2018-02-28 Richard Biener <rguenther@suse.de> 2018-02-28 Richard Biener <rguenther@suse.de>
PR middle-end/84607 PR middle-end/84607
......
2018-02-28 Martin Liska <mliska@suse.cz>
PR testsuite/84597
* g++.dg/ext/timevar1.C: Fix pruned patterns.
* g++.dg/ext/timevar2.C: Likewise.
2018-02-28 Eric Botcazou <ebotcazou@adacore.com> 2018-02-28 Eric Botcazou <ebotcazou@adacore.com>
* c-c++-common/dump-ada-spec-8.c: New test. * c-c++-common/dump-ada-spec-8.c: New test.
......
// PR c++/52248 // PR c++/52248
// { dg-options "-ftime-report" } // { dg-options "-ftime-report" }
// { dg-allow-blank-lines-in-output 1 } // { dg-allow-blank-lines-in-output 1 }
// { dg-prune-output "wall" } // { dg-prune-output "Time variable" }
// { dg-prune-output "times" } // { dg-prune-output " kB" }
// { dg-prune-output "TOTAL" }
// { dg-prune-output "checks" } // { dg-prune-output "checks" }
void void
......
// PR c++/57524 // PR c++/57524
// { dg-options "-ftime-report" } // { dg-options "-ftime-report" }
// { dg-prune-output "wall" } // { dg-prune-output "Time variable" }
// { dg-prune-output "times" } // { dg-prune-output " kB" }
// { dg-prune-output "TOTAL" }
// { dg-prune-output "checks" } // { dg-prune-output "checks" }
namespace detail { namespace detail {
......
...@@ -641,27 +641,27 @@ timer::print_row (FILE *fp, ...@@ -641,27 +641,27 @@ timer::print_row (FILE *fp,
#ifdef HAVE_USER_TIME #ifdef HAVE_USER_TIME
/* Print user-mode time for this process. */ /* Print user-mode time for this process. */
fprintf (fp, "%7.2f (%2.0f%%)", fprintf (fp, "%7.2f (%3.0f%%)",
elapsed.user, elapsed.user,
(total->user == 0 ? 0 : elapsed.user / total->user) * 100); (total->user == 0 ? 0 : elapsed.user / total->user) * 100);
#endif /* HAVE_USER_TIME */ #endif /* HAVE_USER_TIME */
#ifdef HAVE_SYS_TIME #ifdef HAVE_SYS_TIME
/* Print system-mode time for this process. */ /* Print system-mode time for this process. */
fprintf (fp, "%7.2f (%2.0f%%)", fprintf (fp, "%7.2f (%3.0f%%)",
elapsed.sys, elapsed.sys,
(total->sys == 0 ? 0 : elapsed.sys / total->sys) * 100); (total->sys == 0 ? 0 : elapsed.sys / total->sys) * 100);
#endif /* HAVE_SYS_TIME */ #endif /* HAVE_SYS_TIME */
#ifdef HAVE_WALL_TIME #ifdef HAVE_WALL_TIME
/* Print wall clock time elapsed. */ /* Print wall clock time elapsed. */
fprintf (fp, "%7.2f (%2.0f%%)", fprintf (fp, "%7.2f (%3.0f%%)",
elapsed.wall, elapsed.wall,
(total->wall == 0 ? 0 : elapsed.wall / total->wall) * 100); (total->wall == 0 ? 0 : elapsed.wall / total->wall) * 100);
#endif /* HAVE_WALL_TIME */ #endif /* HAVE_WALL_TIME */
/* Print the amount of ggc memory allocated. */ /* Print the amount of ggc memory allocated. */
fprintf (fp, "%8u kB (%2.0f%%)", fprintf (fp, "%8u kB (%3.0f%%)",
(unsigned) (elapsed.ggc_mem >> 10), (unsigned) (elapsed.ggc_mem >> 10),
(total->ggc_mem == 0 (total->ggc_mem == 0
? 0 ? 0
...@@ -712,7 +712,7 @@ timer::print (FILE *fp) ...@@ -712,7 +712,7 @@ timer::print (FILE *fp)
TIMEVAR. */ TIMEVAR. */
m_start_time = now; m_start_time = now;
fprintf (fp, "\n%-35s%15s%13s%13s%17s\n", "Time variable", "usr", "sys", fprintf (fp, "\n%-35s%16s%14s%14s%18s\n", "Time variable", "usr", "sys",
"wall", "GGC"); "wall", "GGC");
if (m_jit_client_items) if (m_jit_client_items)
fputs ("GCC items:\n", fp); fputs ("GCC items:\n", fp);
...@@ -771,12 +771,12 @@ timer::print (FILE *fp) ...@@ -771,12 +771,12 @@ timer::print (FILE *fp)
fprintf (fp, "%7.2f ", total->user); fprintf (fp, "%7.2f ", total->user);
#endif #endif
#ifdef HAVE_SYS_TIME #ifdef HAVE_SYS_TIME
fprintf (fp, "%7.2f ", total->sys); fprintf (fp, "%8.2f ", total->sys);
#endif #endif
#ifdef HAVE_WALL_TIME #ifdef HAVE_WALL_TIME
fprintf (fp, "%7.2f ", total->wall); fprintf (fp, "%8.2f ", total->wall);
#endif #endif
fprintf (fp, "%8u kB\n", (unsigned) (total->ggc_mem >> 10)); fprintf (fp, "%9u kB\n", (unsigned) (total->ggc_mem >> 10));
if (CHECKING_P || flag_checking) if (CHECKING_P || flag_checking)
fprintf (fp, "Extra diagnostic checks enabled; compiler may run slowly.\n"); fprintf (fp, "Extra diagnostic checks enabled; compiler may run slowly.\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment