Add missing target options (PR middle-end/90258).

2019-04-27  Martin Liska  <mliska@suse.cz>

	PR middle-end/90258
	* opt-suggestions.c (option_proposer::build_option_suggestions):
	When get_valid_option_values returns empty values, add the
	misspelling candidate.
2019-04-27  Martin Liska  <mliska@suse.cz>

	PR middle-end/90258
	* gcc.dg/completion-5.c: New test.
	* gcc.target/i386/spellcheck-options-5.c: New test.

From-SVN: r270622
This commit is contained in:
Martin Liska 2019-04-27 08:33:29 +02:00 committed by Martin Liska
parent 5117550700
commit 23ab635042
5 changed files with 29 additions and 1 deletions

View File

@ -1,3 +1,10 @@
2019-04-27 Martin Liska <mliska@suse.cz>
PR middle-end/90258
* opt-suggestions.c (option_proposer::build_option_suggestions):
When get_valid_option_values returns empty values, add the
misspelling candidate.
2019-04-26 Jim Wilson <jimw@sifive.com>
* config/riscv/riscv-protos.h (riscv_move_integer): Add machine_mode

View File

@ -141,12 +141,14 @@ option_proposer::build_option_suggestions (const char *prefix)
}
else
{
bool option_added = false;
if (option->flags & CL_TARGET)
{
vec<const char *> option_values
= targetm_common.get_valid_option_values (i, prefix);
if (!option_values.is_empty ())
{
option_added = true;
for (unsigned j = 0; j < option_values.length (); j++)
{
char *with_arg = concat (opt_text, option_values[j],
@ -158,7 +160,8 @@ option_proposer::build_option_suggestions (const char *prefix)
}
option_values.release ();
}
else
if (!option_added)
add_misspelling_candidates (m_option_suggestions, option,
opt_text);
}

View File

@ -1,3 +1,9 @@
2019-04-27 Martin Liska <mliska@suse.cz>
PR middle-end/90258
* gcc.dg/completion-5.c: New test.
* gcc.target/i386/spellcheck-options-5.c: New test.
2019-04-26 Jim Wilson <jimw@sifive.com>
* gcc.target/riscv/load-immediate.c: New.

View File

@ -0,0 +1,7 @@
/* { dg-do compile { target { i?86-*-* x86_64-*-* } } } */
/* { dg-options "--completion=-mfm" } */
/* { dg-begin-multiline-output "" }
-mfma
-mfma4
{ dg-end-multiline-output "" } */

View File

@ -0,0 +1,5 @@
/* PR middle-end/90258. */
/* { dg-do compile } */
/* { dg-options "-mandroidX" } */
/* { dg-error "unrecognized command line option '-mandroidX'; did you mean '-mandroid'" "" { target *-*-* } 0 } */