]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
arm: testsuite: improve test compatibility of asm-hard-reg-... tests
authorRichard Earnshaw <rearnsha@arm.com>
Tue, 2 Sep 2025 16:02:21 +0000 (17:02 +0100)
committerRichard Earnshaw <rearnsha@arm.com>
Tue, 2 Sep 2025 16:20:16 +0000 (17:20 +0100)
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.

gcc/testsuite/gcc.dg/asm-hard-reg-4.c
gcc/testsuite/gcc.dg/asm-hard-reg-error-3.c

index d319467d60190a280630fd4c23211f722a947bb3..01ae3ad5a7a11c2aa4bdcd93652a0184fb649ae7 100644 (file)
@@ -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}"
index b4254e36381844b4a5a0e30d6788451856859a68..d3962bdc344c43a025ff91bd161fe760e3134e45 100644 (file)
@@ -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.  */