diff options
author | Tom de Vries <tdevries@suse.de> | 2018-11-21 08:10:41 +0000 |
---|---|---|
committer | Tom de Vries <vries@gcc.gnu.org> | 2018-11-21 08:10:41 +0000 |
commit | 25baeeb36ea512632ca128b6fc3f3ab27f17203b (patch) | |
tree | d5fb76f3b41f379967a8b2312657cb138f2fcdfc /gcc | |
parent | 7c74e813c9de0562b447f20fb51de8d36ea396bb (diff) | |
download | gcc-25baeeb36ea512632ca128b6fc3f3ab27f17203b.zip gcc-25baeeb36ea512632ca128b6fc3f3ab27f17203b.tar.gz gcc-25baeeb36ea512632ca128b6fc3f3ab27f17203b.tar.bz2 |
[driver] Ensure --help=params lines end with period
Ensure that gcc --help=params lines end with a period by:
- fixing the help message of param HOT_BB_COUNT_FRACTION, and
- adding a test-case.
Build and tested on x86_64.
2018-11-21 Tom de Vries <tdevries@suse.de>
PR driver/79855
* params.def (HOT_BB_COUNT_FRACTION): Terminate help message with
period.
* lib/options.exp (check_for_options_with_filter): New proc.
* gcc.misc-tests/help.exp: Check that --help=params lines end with
period.
From-SVN: r266338
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/params.def | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/testsuite/gcc.misc-tests/help.exp | 2 | ||||
-rw-r--r-- | gcc/testsuite/lib/options.exp | 34 |
5 files changed, 46 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0f43084..bff4dfb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-11-21 Tom de Vries <tdevries@suse.de> + + PR driver/79855 + * params.def (HOT_BB_COUNT_FRACTION): Terminate help message with + period. + 2018-11-21 Andreas Krebbel <krebbel@linux.ibm.com> * configure.ac: Add check for Binutils to determine whether vector diff --git a/gcc/params.def b/gcc/params.def index 2ae5a00..11396a7 100644 --- a/gcc/params.def +++ b/gcc/params.def @@ -397,7 +397,7 @@ DEFPARAM(PARAM_SMS_LOOP_AVERAGE_COUNT_THRESHOLD, DEFPARAM(HOT_BB_COUNT_FRACTION, "hot-bb-count-fraction", "Select fraction of the maximal count of repetitions of basic block in program given basic " - "block needs to have to be considered hot (used in non-LTO mode)", + "block needs to have to be considered hot (used in non-LTO mode).", 10000, 0, 0) DEFPARAM(HOT_BB_COUNT_WS_PERMILLE, "hot-bb-count-ws-permille", diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 50c7f15..855cc59 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2018-11-21 Tom de Vries <tdevries@suse.de> + + PR driver/79855 + * lib/options.exp (check_for_options_with_filter): New proc. + * gcc.misc-tests/help.exp: Check that --help=params lines end with + period. + 2018-11-21 Jakub Jelinek <jakub@redhat.com> Mark Eggleston <mark.eggleston@codethink.com> diff --git a/gcc/testsuite/gcc.misc-tests/help.exp b/gcc/testsuite/gcc.misc-tests/help.exp index f40cfab..34ff940 100644 --- a/gcc/testsuite/gcc.misc-tests/help.exp +++ b/gcc/testsuite/gcc.misc-tests/help.exp @@ -63,6 +63,8 @@ check_for_options c "-v --help" "" {are likely to\n -std} "" # Try various --help= classes and qualifiers. check_for_options c "--help=optimizers" "-O" " -g " "" check_for_options c "--help=params" "maximum number of" "-Wunsafe-loop-optimizations" "" +check_for_options_with_filter c "--help=params" \ + "^The --param option recognizes the following as parameters:$" "" {[^.]$} "" check_for_options c "--help=C" "-ansi" "-gnatO" "" check_for_options c {--help=C++} {-std=c\+\+} "-gnatO" "" check_for_options c "--help=common" "-dumpbase" "-gnatO" "" diff --git a/gcc/testsuite/lib/options.exp b/gcc/testsuite/lib/options.exp index 824d912..60d85ee 100644 --- a/gcc/testsuite/lib/options.exp +++ b/gcc/testsuite/lib/options.exp @@ -26,11 +26,14 @@ if { [ishost "*-*-cygwin*"] } { } # Run the LANGUAGE compiler with GCC_OPTIONS and inspect the compiler -# output to make sure that they match the newline-separated patterns -# in COMPILER_PATTERNS but not the patterns in COMPILER_NON_PATTERNS. -# In case of failure, xfail if XFAIL is nonempty. +# output excluding EXCLUDE lines to make sure that they match the +# newline-separated patterns in COMPILER_PATTERNS but not the patterns in +# COMPILER_NON_PATTERNS. In case of failure, xfail if XFAIL is nonempty. -proc check_for_options {language gcc_options compiler_patterns compiler_non_patterns expected_failure} { +proc check_for_options_with_filter { language gcc_options exclude \ + compiler_patterns \ + compiler_non_patterns \ + expected_failure } { set filename test-[pid] set fd [open $filename.c w] puts $fd "int main (void) { return 0; }" @@ -47,6 +50,21 @@ proc check_for_options {language gcc_options compiler_patterns compiler_non_patt set gcc_output [gcc_target_compile $filename.c $filename.x executable $gcc_options] remote_file build delete $filename.c $filename.x $filename.gcno + if { $exclude != "" } { + set lines [split $gcc_output "\n"] + set gcc_output "" + foreach line $lines { + if {[regexp -line -- "$exclude" $line]} { + continue + } + if { $gcc_output == "" } { + set gcc_output "$line" + } else { + set gcc_output "$gcc_output\n$line" + } + } + } + # Verify that COMPILER_PATTERRNS appear in gcc output. foreach pattern [split $compiler_patterns "\n"] { if {$pattern != ""} { @@ -79,3 +97,11 @@ proc check_for_options {language gcc_options compiler_patterns compiler_non_patt } } } + +# As check_for_options_with_filter, but without the EXCLUDE parameter. + +proc check_for_options { language gcc_options compiler_patterns \ + compiler_non_patterns expected_failure } { + check_for_options_with_filter $language $gcc_options "" $compiler_patterns \ + $compiler_non_patterns $expected_failure +} |