This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] testsuite: effective_target_march_option: support checking for -march=*
- From: Hans-Peter Nilsson <hp at axis dot com>
- To: <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 18 Jan 2020 13:35:16 +0100
- Subject: [PATCH] testsuite: effective_target_march_option: support checking for -march=*
- Ironport-sdr: ayzQDri5/WjhxUmOdr01cvb7Ymb774z3sBDjLrLbdk5kdvljmgID8jUN98RLYqAcmy5sFw/CTf S7/7JXxu8Ql5RdSJE9CKQPmy5FpacEvJ0+HVEU0sl3e7oDW+HQjJJi6pkHrcoGKk2LvrUtuKZR 1ATMWpeyIaMtoVbeMW3w9gb0BCrxizIdkFmbM+zLUPmZGu7KOou53DX+y189zT//+2OCnoLGkN oMndn01BU73N8s1/9iaUKNTelglysNp0WFOkdWG7CKcKpk9dLLXe4F/hsqiJD2O6V0pfSTXeWj bJs=
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.
See example last.
Ok to commit the below?
---
gcc/testsuite/lib/target-supports.exp | 4 ++++
1 file changed, 4 insertions(+)
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;
brgds, H-P