[gcc r16-3527] arm: testsuite: improve test compatibility of asm-hard-reg-... tests
Richard Earnshaw
rearnsha@gcc.gnu.org
Tue Sep 2 16:20:56 GMT 2025
https://gcc.gnu.org/g:4ce7722c02e449b5f9947a255705502d13632c90
commit r16-3527-g4ce7722c02e449b5f9947a255705502d13632c90
Author: Richard Earnshaw <rearnsha@arm.com>
Date: Tue Sep 2 17:02:21 2025 +0100
arm: testsuite: improve test compatibility of asm-hard-reg-... tests
On arm, overriding -march can lead to warnings if the testsuite
options try to pass -mcpu. Avoid these by ensuring the -mcpu is unset
before adding the architecture.
Also, improve the compatibility of asm-hard-reg-error-3.c for
hard-float environment by allowing FP instructions in the
architecture.
gcc/testsuite:
* gcc.dg/asm-hard-reg-4.c: On Arm, unset the CPU before
setting the arch.
* gcc.dg/asm-hard-reg-error-3.c: Similarly. Also add
floating-point instructions to aid hard-float variants.
Match on arm* not just arm.
Diff:
---
gcc/testsuite/gcc.dg/asm-hard-reg-4.c | 2 +-
gcc/testsuite/gcc.dg/asm-hard-reg-error-3.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/gcc/testsuite/gcc.dg/asm-hard-reg-4.c b/gcc/testsuite/gcc.dg/asm-hard-reg-4.c
index d319467d6019..01ae3ad5a7a1 100644
--- a/gcc/testsuite/gcc.dg/asm-hard-reg-4.c
+++ b/gcc/testsuite/gcc.dg/asm-hard-reg-4.c
@@ -6,7 +6,7 @@
/* { dg-final { scan-assembler-times "foo\tv5" 4 { target { aarch64*-*-* } } } } */
#elif defined (__arm__)
# define FPR "{d5}"
-/* { dg-additional-options "-march=armv7-a+fp -mfloat-abi=hard" { target arm*-*-* } } */
+/* { dg-additional-options "-mcpu=unset -march=armv7-a+fp -mfloat-abi=hard" { target arm*-*-* } } */
/* { dg-final { scan-assembler-times "foo\ts10" 4 { target { arm*-*-* } } } } */
#elif defined (__powerpc__) || defined (__POWERPC__)
# define FPR "{5}"
diff --git a/gcc/testsuite/gcc.dg/asm-hard-reg-error-3.c b/gcc/testsuite/gcc.dg/asm-hard-reg-error-3.c
index b4254e363818..d3962bdc344c 100644
--- a/gcc/testsuite/gcc.dg/asm-hard-reg-error-3.c
+++ b/gcc/testsuite/gcc.dg/asm-hard-reg-error-3.c
@@ -1,6 +1,6 @@
-/* { dg-do compile { target arm-*-* s390-*-* } } */
+/* { dg-do compile { target arm*-*-* s390-*-* } } */
/* { dg-options "-std=c99" } we need long long */
-/* { dg-additional-options "-march=armv7-a -marm" { target arm-*-* } } */
+/* { dg-additional-options "-mcpu=unset -march=armv7-a+fp -marm" { target arm*-*-* } } */
/* Test register pairs. */
More information about the Gcc-cvs
mailing list