From: Martin Liska Date: Wed, 28 Feb 2018 13:45:59 +0000 (+0100) Subject: Fix timevar format and fix tests (PR testsuite/84597). X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4830cfc0a0cffb1c6f3ab9ec08b9b43681e7868c;p=gcc.git Fix timevar format and fix tests (PR testsuite/84597). 2018-02-28 Martin Liska PR testsuite/84597 * timevar.c (timer::print): Fix format to properly print 100% values. 2018-02-28 Martin Liska PR testsuite/84597 * g++.dg/ext/timevar1.C: Fix pruned patterns. * g++.dg/ext/timevar2.C: Likewise. From-SVN: r258063 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d7f8754d2e9..820b926ced7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-02-28 Martin Liska + + PR testsuite/84597 + * timevar.c (timer::print): Fix format to properly print 100% + values. + 2018-02-28 Richard Biener PR middle-end/84607 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a464fbd2ed9..f799a93685b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2018-02-28 Martin Liska + + PR testsuite/84597 + * g++.dg/ext/timevar1.C: Fix pruned patterns. + * g++.dg/ext/timevar2.C: Likewise. + 2018-02-28 Eric Botcazou * c-c++-common/dump-ada-spec-8.c: New test. diff --git a/gcc/testsuite/g++.dg/ext/timevar1.C b/gcc/testsuite/g++.dg/ext/timevar1.C index a48f8ba3705..3f891a50aba 100644 --- a/gcc/testsuite/g++.dg/ext/timevar1.C +++ b/gcc/testsuite/g++.dg/ext/timevar1.C @@ -1,9 +1,8 @@ // PR c++/52248 // { dg-options "-ftime-report" } // { dg-allow-blank-lines-in-output 1 } -// { dg-prune-output "wall" } -// { dg-prune-output "times" } -// { dg-prune-output "TOTAL" } +// { dg-prune-output "Time variable" } +// { dg-prune-output " kB" } // { dg-prune-output "checks" } void diff --git a/gcc/testsuite/g++.dg/ext/timevar2.C b/gcc/testsuite/g++.dg/ext/timevar2.C index 74c4fc8cfae..dd96d45c01e 100644 --- a/gcc/testsuite/g++.dg/ext/timevar2.C +++ b/gcc/testsuite/g++.dg/ext/timevar2.C @@ -1,8 +1,7 @@ // PR c++/57524 // { dg-options "-ftime-report" } -// { dg-prune-output "wall" } -// { dg-prune-output "times" } -// { dg-prune-output "TOTAL" } +// { dg-prune-output "Time variable" } +// { dg-prune-output " kB" } // { dg-prune-output "checks" } namespace detail { diff --git a/gcc/timevar.c b/gcc/timevar.c index d209f5be0f5..2a7defbcc8c 100644 --- a/gcc/timevar.c +++ b/gcc/timevar.c @@ -641,27 +641,27 @@ timer::print_row (FILE *fp, #ifdef HAVE_USER_TIME /* Print user-mode time for this process. */ - fprintf (fp, "%7.2f (%2.0f%%)", + fprintf (fp, "%7.2f (%3.0f%%)", elapsed.user, (total->user == 0 ? 0 : elapsed.user / total->user) * 100); #endif /* HAVE_USER_TIME */ #ifdef HAVE_SYS_TIME /* Print system-mode time for this process. */ - fprintf (fp, "%7.2f (%2.0f%%)", + fprintf (fp, "%7.2f (%3.0f%%)", elapsed.sys, (total->sys == 0 ? 0 : elapsed.sys / total->sys) * 100); #endif /* HAVE_SYS_TIME */ #ifdef HAVE_WALL_TIME /* Print wall clock time elapsed. */ - fprintf (fp, "%7.2f (%2.0f%%)", + fprintf (fp, "%7.2f (%3.0f%%)", elapsed.wall, (total->wall == 0 ? 0 : elapsed.wall / total->wall) * 100); #endif /* HAVE_WALL_TIME */ /* Print the amount of ggc memory allocated. */ - fprintf (fp, "%8u kB (%2.0f%%)", + fprintf (fp, "%8u kB (%3.0f%%)", (unsigned) (elapsed.ggc_mem >> 10), (total->ggc_mem == 0 ? 0 @@ -712,7 +712,7 @@ timer::print (FILE *fp) TIMEVAR. */ 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"); if (m_jit_client_items) fputs ("GCC items:\n", fp); @@ -771,12 +771,12 @@ timer::print (FILE *fp) fprintf (fp, "%7.2f ", total->user); #endif #ifdef HAVE_SYS_TIME - fprintf (fp, "%7.2f ", total->sys); + fprintf (fp, "%8.2f ", total->sys); #endif #ifdef HAVE_WALL_TIME - fprintf (fp, "%7.2f ", total->wall); + fprintf (fp, "%8.2f ", total->wall); #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) fprintf (fp, "Extra diagnostic checks enabled; compiler may run slowly.\n");