From: Torbjörn SVENSSON <[email protected]>

In order for the tests to pass, -mcpu=unset is needed to avoid conflict
between -march and any previous -mcpu argument.

Only run tests when able to, potentially, switch target to
armv8-m.main+fp and armv8.1-m.main+mve.
I did not use dg-add-options to do the target switching since it might
allow more options for the arch than +fp/+mve, for example +dsp, and
this will cause the

scan-rtl-dump final "call \\(mem:SI \\(reg/f:SI [0-7] r[0-7]"

test to fail.

gcc/testsuite/ChangeLog:

        * gcc.target/arm/cmse/cmse-18.c: Require effective target
        arm_arch_v8m_main_ok and add -mcpu=unset.
        * gcc.target/arm/cmse/cmse-19.c: Require effective target
        arm_v8_1m_mve_ok and add -mcpu=unset.

Signed-off-by: Torbjörn SVENSSON <[email protected]>
---
 gcc/testsuite/gcc.target/arm/cmse/cmse-18.c | 3 ++-
 gcc/testsuite/gcc.target/arm/cmse/cmse-19.c | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/gcc/testsuite/gcc.target/arm/cmse/cmse-18.c 
b/gcc/testsuite/gcc.target/arm/cmse/cmse-18.c
index eb8a358481dfb..191622f8f4342 100644
--- a/gcc/testsuite/gcc.target/arm/cmse/cmse-18.c
+++ b/gcc/testsuite/gcc.target/arm/cmse/cmse-18.c
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
+/* { dg-require-effective-target arm_arch_v8m_main_ok } */
 /* Make sure FPCXT is not enabled.  */
-/* { dg-options "-mcmse -fdump-rtl-final -march=armv8-m.main+fp" } */
+/* { dg-options "-mcmse -fdump-rtl-final -mcpu=unset -march=armv8-m.main+fp" } 
*/
 
 typedef void (*f)(int) __attribute__((cmse_nonsecure_call));
 
diff --git a/gcc/testsuite/gcc.target/arm/cmse/cmse-19.c 
b/gcc/testsuite/gcc.target/arm/cmse/cmse-19.c
index ae075c371f6ed..13081ffc8b226 100644
--- a/gcc/testsuite/gcc.target/arm/cmse/cmse-19.c
+++ b/gcc/testsuite/gcc.target/arm/cmse/cmse-19.c
@@ -1,7 +1,8 @@
 /* { dg-do compile } */
+/* { dg-require-effective-target arm_v8_1m_mve_ok } */
 /* This is a duplicate of cmse-18.c, targetting arm_v8_1m_mve, to make sure
    FPCXT is enabled.  */
-/* { dg-options "-mcmse -fdump-rtl-final -march=armv8.1-m.main+mve" } */
+/* { dg-options "-mcmse -fdump-rtl-final -mcpu=unset 
-march=armv8.1-m.main+mve" } */
 
 typedef void (*f)(int) __attribute__((cmse_nonsecure_call));
 
-- 
2.54.0

Reply via email to