On 19/11/2024 10:23, Torbjörn SVENSSON wrote: > Update test cases to use -mcpu=unset/-march=unset feature introduced in > r15-3606-g7d6c6a0d15c. > > gcc/testsuite/ChangeLog: > > * gcc.target/arm/acle/pacbti-m-predef-1.c: Use effective-target > arm_arch_v8_1m_main. > * gcc.target/arm/acle/pacbti-m-predef-2.c: Likewise. > * gcc.target/arm/acle/pacbti-m-predef-3.c: Likewise. > * gcc.target/arm/acle/pacbti-m-predef-4.c: Likewise. > * gcc.target/arm/acle/pacbti-m-predef-5.c: Likewise. > * gcc.target/arm/acle/pacbti-m-predef-6.c: Likewise. > * gcc.target/arm/acle/pacbti-m-predef-8.c: Likewise. > * gcc.target/arm/acle/pacbti-m-predef-9.c: Likewise. > * gcc.target/arm/acle/pacbti-m-predef-10.c: Likewise. > * gcc.target/arm/acle/pacbti-m-predef-11.c: Likewise.
This is OK. I'll note, however, that I think /* { dg-require-effective-target mbranch_protection_ok } */ Is redundant in all these tests (and possibly also in patch 1 of this series). The check is testing that -mbranch-protection=standard can be used with the default compilation flags (and not give rise to "cc1: error: This architecture does not support branch protection instructions"). But we're forcing the architecture to something we know supports branch protection, so we don't need to test for that here. Removing this check would make these tests available in more test runs. R. > > Signed-off-by: Torbjörn SVENSSON <torbjorn.svens...@foss.st.com> > --- > gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-1.c | 4 +++- > gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-10.c | 4 +++- > gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-2.c | 4 +++- > gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-3.c | 4 +++- > gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-4.c | 4 +++- > gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-5.c | 5 +++-- > gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-6.c | 4 +++- > gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-8.c | 4 +++- > gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-9.c | 4 +++- > 9 files changed, 27 insertions(+), 10 deletions(-) > > diff --git a/gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-1.c > b/gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-1.c > index 122f7a762a7..0abc3372149 100644 > --- a/gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-1.c > +++ b/gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-1.c > @@ -1,6 +1,8 @@ > /* { dg-do compile } */ > +/* { dg-require-effective-target arm_arch_v8_1m_main_ok } */ > /* { dg-require-effective-target mbranch_protection_ok } */ > -/* { dg-options "-march=armv8.1-m.main+fp -mbranch-protection=pac-ret+bti > -mfloat-abi=hard --save-temps" } */ > +/* { dg-options "-mbranch-protection=pac-ret+bti -mfloat-abi=hard > --save-temps" } */ > +/* { dg-add-options arm_arch_v8_1m_main } */ > > #if !defined (__ARM_FEATURE_BTI_DEFAULT) > #error "Feature test macro __ARM_FEATURE_BTI_DEFAULT should be defined." > diff --git a/gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-10.c > b/gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-10.c > index 52d18238109..08f90a9d9c1 100644 > --- a/gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-10.c > +++ b/gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-10.c > @@ -1,6 +1,8 @@ > /* { dg-do compile } */ > +/* { dg-require-effective-target arm_arch_v8_1m_main_ok } */ > /* { dg-require-effective-target mbranch_protection_ok } */ > -/* { dg-additional-options "-march=armv8.1-m.main+fp > -mbranch-protection=bti+pac-ret -mfloat-abi=hard" } */ > +/* { dg-additional-options "-mbranch-protection=bti+pac-ret > -mfloat-abi=hard" } */ > +/* { dg-add-options arm_arch_v8_1m_main } */ > > #if (__ARM_FEATURE_BTI_DEFAULT != 1) > #error "Feature test macro __ARM_FEATURE_BTI_DEFAULT should be defined to 1." > diff --git a/gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-2.c > b/gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-2.c > index cd418ce0c7f..de34cc87f99 100644 > --- a/gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-2.c > +++ b/gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-2.c > @@ -1,7 +1,9 @@ > /* { dg-do run } */ > +/* { dg-require-effective-target arm_arch_v8_1m_main_pacbti_link } */ > /* { dg-require-effective-target mbranch_protection_ok } */ > /* { dg-require-effective-target arm_pacbti_hw } */ > -/* { dg-options "-march=armv8.1-m.main+pacbti+fp > -mbranch-protection=bti+pac-ret+leaf -mthumb -mfloat-abi=hard" } */ > +/* { dg-options "-mbranch-protection=bti+pac-ret+leaf -mfloat-abi=hard" } */ > +/* { dg-add-options arm_arch_v8_1m_main_pacbti } */ > > #if !defined (__ARM_FEATURE_BTI_DEFAULT) > #error "Feature test macro __ARM_FEATURE_BTI_DEFAULT should be defined." > diff --git a/gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-3.c > b/gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-3.c > index b94f3447ad9..e19e41626dd 100644 > --- a/gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-3.c > +++ b/gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-3.c > @@ -1,6 +1,8 @@ > /* { dg-do compile } */ > +/* { dg-require-effective-target arm_arch_v8_1m_main_ok } */ > /* { dg-require-effective-target mbranch_protection_ok } */ > -/* { dg-options "-march=armv8.1-m.main+fp -mbranch-protection=pac-ret+leaf > -mfloat-abi=hard --save-temps" } */ > +/* { dg-options "-mbranch-protection=pac-ret+leaf -mfloat-abi=hard > --save-temps" } */ > +/* { dg-add-options arm_arch_v8_1m_main } */ > > #if defined (__ARM_FEATURE_BTI_DEFAULT) > #error "Feature test macro __ARM_FEATURE_BTI_DEFAULT should be undefined." > diff --git a/gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-4.c > b/gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-4.c > index ce4b45ab464..9040b0a6464 100644 > --- a/gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-4.c > +++ b/gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-4.c > @@ -1,6 +1,8 @@ > /* { dg-do run } */ > +/* { dg-require-effective-target arm_arch_v8_1m_main_pacbti_link } */ > /* { dg-require-effective-target arm_pacbti_hw } */ > -/* { dg-options "-march=armv8.1-m.main+pacbti+fp -mbranch-protection=pac-ret > -mthumb -mfloat-abi=hard" } */ > +/* { dg-options "-mbranch-protection=pac-ret -mfloat-abi=hard" } */ > +/* { dg-add-options arm_arch_v8_1m_main_pacbti } */ > > #if !defined (__ARM_FEATURE_PAC_DEFAULT) > #error "Feature test macro __ARM_FEATURE_BTI_DEFAULT should be defined." > diff --git a/gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-5.c > b/gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-5.c > index 6d48b7c31a5..106d20f27d2 100644 > --- a/gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-5.c > +++ b/gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-5.c > @@ -1,8 +1,9 @@ > /* { dg-do run } */ > +/* { dg-require-effective-target arm_arch_v8_1m_main_link } */ > /* { dg-require-effective-target mbranch_protection_ok } */ > /* { dg-require-effective-target arm_pacbti_hw } */ > -/* { dg-skip-if "do not override march" { *-*-* } { "-march=*" } { > "-march=armv8.1-m.main" } } */ > -/* { dg-additional-options "-march=armv8.1-m.main > -mbranch-protection=bti+pac-ret" } */ > +/* { dg-additional-options "-mbranch-protection=bti+pac-ret" } */ > +/* { dg-add-options arm_arch_v8_1m_main } */ > > #if !defined (__ARM_FEATURE_BTI_DEFAULT) > #error "Feature test macro __ARM_FEATURE_BTI_DEFAULT should be defined." > diff --git a/gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-6.c > b/gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-6.c > index ed52afc83c5..083d2b6569a 100644 > --- a/gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-6.c > +++ b/gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-6.c > @@ -1,6 +1,8 @@ > /* { dg-do compile } */ > +/* { dg-require-effective-target arm_arch_v8_1m_main_ok } */ > /* { dg-require-effective-target mbranch_protection_ok } */ > -/* { dg-additional-options "-march=armv8.1-m.main+fp -mbranch-protection=bti > -mfloat-abi=hard --save-temps" } */ > +/* { dg-additional-options "-mbranch-protection=bti -mfloat-abi=hard > --save-temps" } */ > +/* { dg-add-options arm_arch_v8_1m_main } */ > > #if !defined (__ARM_FEATURE_BTI_DEFAULT) > #error "Feature test macro __ARM_FEATURE_BTI_DEFAULT should be defined." > diff --git a/gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-8.c > b/gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-8.c > index 3538c186397..17fc7f57c72 100644 > --- a/gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-8.c > +++ b/gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-8.c > @@ -1,6 +1,8 @@ > /* { dg-do compile } */ > +/* { dg-require-effective-target arm_arch_v8_1m_main_ok } */ > /* { dg-require-effective-target mbranch_protection_ok } */ > -/* { dg-additional-options "-march=armv8.1-m.main+fp > -mbranch-protection=bti+pac-ret+leaf -mfloat-abi=hard" } */ > +/* { dg-additional-options "-mbranch-protection=bti+pac-ret+leaf > -mfloat-abi=hard" } */ > +/* { dg-add-options arm_arch_v8_1m_main } */ > > #if (__ARM_FEATURE_BTI_DEFAULT != 1) > #error "Feature test macro __ARM_FEATURE_BTI_DEFAULT should be defined to 1." > diff --git a/gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-9.c > b/gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-9.c > index 27c1c8f521c..822515c8c0a 100644 > --- a/gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-9.c > +++ b/gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-9.c > @@ -1,6 +1,8 @@ > /* { dg-do compile } */ > +/* { dg-require-effective-target arm_arch_v8_1m_main_ok } */ > /* { dg-require-effective-target mbranch_protection_ok } */ > -/* { dg-additional-options "-march=armv8.1-m.main+fp > -mbranch-protection=pac-ret -mfloat-abi=hard" } */ > +/* { dg-additional-options "-mbranch-protection=pac-ret -mfloat-abi=hard" } > */ > +/* { dg-add-options arm_arch_v8_1m_main } */ > > #if (__ARM_FEATURE_PAC_DEFAULT != 1) > #error "Feature test macro __ARM_FEATURE_PAC_DEFAULT should be defined to 1."