diff options
author | Martin Sebor <msebor@redhat.com> | 2019-07-24 20:34:03 +0000 |
---|---|---|
committer | Martin Sebor <msebor@gcc.gnu.org> | 2019-07-24 14:34:03 -0600 |
commit | fa5baeedd47e84b36aff8191bfdf86ee03829a4c (patch) | |
tree | 555ecd4cee3204df4576e6ad2ed71999246dd69c /gcc/testsuite | |
parent | e34616747028ebeb0be867dc6a23682539bfab60 (diff) | |
download | gcc-fa5baeedd47e84b36aff8191bfdf86ee03829a4c.zip gcc-fa5baeedd47e84b36aff8191bfdf86ee03829a4c.tar.gz gcc-fa5baeedd47e84b36aff8191bfdf86ee03829a4c.tar.bz2 |
PR driver/80545 - option -Wstringop-overflow not recognized by Fortran
gcc/cp/ChangeLog:
PR driver/80545
* decl.c (finish_function): Use lang_mask.
gcc/testsuite/ChangeLog:
PR driver/80545
* gcc.misc-tests/help.exp: Add tests.
* lib/options.exp: Handle C++.
gcc/ChangeLog:
PR driver/80545
* diagnostic.c (diagnostic_classify_diagnostic): Use lang_mask.
(diagnostic_report_diagnostic): Same.
* diagnostic.h (diagnostic_context::option_enabled): Add an argument.
(diagnostic_context::lang_mask): New data member.
* ipa-pure-const.c (suggest_attribute): Use
lang_hooks.option_lang_mask ().
* opts-common.c (option_enabled): Handle new argument.
(get_option_state): Pass an additional argument.
* opts.c (print_filtered_help): Print supported languages for
unsupported options. Adjust printing of current state.
* opts.h (option_enabled): Add argument.
* toplev.c (print_switch_values): Use lang_mask.
(general_init): Set global_dc->lang_mask.
From-SVN: r273771
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/gcc.misc-tests/help.exp | 28 | ||||
-rw-r--r-- | gcc/testsuite/lib/options.exp | 27 |
3 files changed, 52 insertions, 9 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 621eda9..4749b0c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2019-07-24 Martin Sebor <msebor@redhat.com> + + PR driver/80545 + * gcc.misc-tests/help.exp: Add tests. + * lib/options.exp: Handle C++. + 2019-07-24 Claudiu Zissulescu <claziss@synopsys.com> * gcc.target/arc/arc.exp (check_effective_target_accregs): New diff --git a/gcc/testsuite/gcc.misc-tests/help.exp b/gcc/testsuite/gcc.misc-tests/help.exp index 307f1e9..b8a09fc 100644 --- a/gcc/testsuite/gcc.misc-tests/help.exp +++ b/gcc/testsuite/gcc.misc-tests/help.exp @@ -91,6 +91,34 @@ maximum number of -O } "" "" +# Verify that a C++/Objective C++ only option is indicated as such +# by the C compiler. +check_for_options c "-Q --help=warnings" { +-Wclass-memaccess[ \t]+\[available in C\+\+, ObjC\+\+\] +} "" "" + +# Do the same for a C/Objective C only option and the C++ compiler. +check_for_options c++ "-Q --help=warnings" { +-Wabsolute-value[ \t]+\[available in C, ObjC\] +} "" "" + +# Verify that an option that's an alias for another option is shown +# with the other option as the value. +check_for_options c "-Q --help=warnings" { +--all-warnings[ \t]+\-Wall +-W[ \t]+-Wextra +-Wmissing-format-attribute[ \t]+-Wsuggest-attribute=format +-Wno-alloc-size-larger-than[ \t]+-Walloc-size-larger-than=[1-9][0-9]+ +-Wno-vla-larger-than[ \t]+-Wvla-larger-than=[1-9][0-9]+ +} "" "" + +# Verify that an option that expects a byte-size argument is shown with +# a meaningful byte-size argument as the value. +check_for_options c "-Q --help=warnings" { +-Walloc-size-larger-than=[ \t]+[1-9][0-9]+ bytes +-Wlarger-than=[^\n\r]+[1-9][0-9]+ bytes +} "" "" + # Ensure PR 37805 is fixed. # Specify patterns (arguments 3 and later) that match option names # at the beginning of the line and not when they are referenced by diff --git a/gcc/testsuite/lib/options.exp b/gcc/testsuite/lib/options.exp index b850307..c8f0c70 100644 --- a/gcc/testsuite/lib/options.exp +++ b/gcc/testsuite/lib/options.exp @@ -34,21 +34,30 @@ 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; }" - close $fd - remote_download host $filename.c - set test "compiler driver $gcc_options option(s):" set gcc_options "\{additional_flags=$gcc_options\}" switch "$language" { - "c" { set compiler cc1 } + "c" { + set compiler cc1 + set suffix c + } + "c++" { + set compiler cc1plus + set suffix cc + } default { error "unknown language" } } - set gcc_output [gcc_target_compile $filename.c $filename.x executable $gcc_options] - remote_file build delete $filename.c $filename.x $filename.gcno + + set filebase test-[pid] + set srcfname $filebase.$suffix + set fd [open $srcfname w] + puts $fd "int main (void) { return 0; }" + close $fd + remote_download host $srcfname + + set gcc_output [gcc_target_compile $srcfname $filebase.x executable $gcc_options] + remote_file build delete $srcfname $filebase.x $filebase.gcno if { $exclude != "" } { set lines [split $gcc_output "\n"] |