Message ID | 202001181235.00ICZGdY002602@ignucius.se.axis.com |
---|---|
State | New |
Headers | show |
Series | testsuite: effective_target_march_option: support checking for -march=* | expand |
> On Jan 18, 2020, at 4:35 AM, Hans-Peter Nilsson <hp@axis.com> wrote: > > testsuite: > * lib/target-supports.exp (effective_target_march_option): New. > > I see no (other) way to, depending on the absence of an option, > add an option for a specific target. Specifically, I don't see > how to do this with dg-skip-if and its friends. > > For gcc.dg/torture/pr26515.c and cris-elf, you get an error for > supplying multiple (different) -march=... options (and that > error is desirable), like testing cris-elf with > RUNTESTFLAGS=--target_board=cris-sim/arch=v8, where otherwise > -march=v10 and -march=v8 will both be given, and the test would > fail. > > Ok to commit the below? Ok. [ If the arm folks want to chime in with any great ideas... ]
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 629b454..565cb62 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -2463,6 +2463,10 @@ proc check_effective_target_ti_c64xp { } { }] } +# Check if a -march=... option is given, as part of (earlier) options. +proc check_effective_target_march_option { } { + return [check-flags [list "" { *-*-* } { "-march=*" } { "" } ]] +} proc check_alpha_max_hw_available { } { return [check_runtime alpha_max_hw_available { -- 2.11.0 Example usage (one of several similar, which will be committed together with the above, if approved): diff --git a/gcc/testsuite/gcc.dg/torture/pr26515.c b/gcc/testsuite/gcc.dg/torture/pr26515.c index a051e2e..ff765ba 100644 --- a/gcc/testsuite/gcc.dg/torture/pr26515.c +++ b/gcc/testsuite/gcc.dg/torture/pr26515.c @@ -1,4 +1,4 @@ -/* { dg-options "-march=v10" { target cris*-*-* } } */ +/* { dg-options "-march=v10" { target { cris*-*-* && { ! march_option } } } } */ struct i { long long i_size;