[gcc(refs/users/marxin/heads/marxin-gcc-benchmark-branch)] testsuite: effective_target_march_option: support checking for -march=*

Martin Liska marxin@gcc.gnu.org
Mon Mar 30 10:16:12 GMT 2020


https://gcc.gnu.org/g:3684bbb022cd75da55e1457673f269980aa12cdf

commit 3684bbb022cd75da55e1457673f269980aa12cdf
Author: Hans-Peter Nilsson <hp@axis.com>
Date:   Sun Jan 19 20:38:06 2020 +0100

    testsuite: effective_target_march_option: support checking for -march=*
    
            * 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.
    
    For gcc.dg/torture/pr26515.c and cris-elf, you get an error for
    supplying multiple (different) -march=... options (where 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.
    
    For historians, this was accidentally misordered and committed after
    the (first) patch using march_option.  Oops.

Diff:
---
 gcc/testsuite/ChangeLog               | 1 +
 gcc/testsuite/lib/target-supports.exp | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 21d31a5c6b0..c5d3ce956ed 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -4,6 +4,7 @@
 	-march=v10 option on target ! march_option.
 	* gcc.target/cris/asm-v10.S, gcc.target/cris/inasm-v10.c,
 	gcc.target/cris/sync-1-v10.c: Similar.
+	* lib/target-supports.exp (effective_target_march_option): New.
 
 2020-01-19  Thomas König  <tkoenig@gcc.gnu.org>
 
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 79166986c77..cdee31e2413 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -2477,6 +2477,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 {


More information about the Gcc-cvs mailing list