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/pac-1.c: Use effective-target
>       arm_arch_v8_1m_main_pacbti.
>       * gcc.target/arm/pac-1.c: Likewise.
>       * gcc.target/arm/pac-2.c: Likewise.
>       * gcc.target/arm/pac-3.c: Likewise.
>       * gcc.target/arm/pac-4.c: Likewise.
>       * gcc.target/arm/pac-5.c: Likewise.
>       * gcc.target/arm/pac-7.c: Likewise.
>       * gcc.target/arm/pac-8.c: Likewise.
>       * gcc.target/arm/pac-9.c: Likewise.
>       * gcc.target/arm/pac-10.c: Likewise.
>       * gcc.target/arm/pac-11.c: Likewise.
>       * gcc.target/arm/pac-sibcall.c: Likewise.
>       * gcc.target/arm/pac-sibcall-2.c: Likewise.
>       * gcc.target/arm/pac-sibcall-3.c: Likewise.
>       * gcc.target/arm/pac-12.c: Added option "-mcpu=unset".
>       * gcc.target/arm/pac-13.c: Likewise.
>       * gcc.target/arm/pac-14.c: Likewise.
>       * lib/target-supports.exp(check_effective_target_arm_pacbti_hw):

Space before '('.

>       Likewise.
>       * gcc.target/arm/pac-6.c: Use effective-target
>       arm_arch_v8_1m_main.
>       * gcc.target/arm/pac-15.c: Use effective-target
>       arm_arch_v8_1m_main_pacbti and added option "-mcpu=unset".

This is OK.  I think there are some general structural issues with the 
framework for these tests[1], but this is an incremental improvement.

R.

[1] Eg we have "dg-do run" with a hardware check and scan-assembler in the same 
test.

> 
> Signed-off-by: Torbjörn SVENSSON <torbjorn.svens...@foss.st.com>
> Co-authored-by: Yvan ROUX <yvan.r...@foss.st.com>
> ---
>  gcc/testsuite/gcc.target/arm/pac-1.c  | 4 +++-
>  gcc/testsuite/gcc.target/arm/pac-10.c | 4 +++-
>  gcc/testsuite/gcc.target/arm/pac-11.c | 4 +++-
>  gcc/testsuite/gcc.target/arm/pac-12.c | 2 +-
>  gcc/testsuite/gcc.target/arm/pac-13.c | 2 +-
>  gcc/testsuite/gcc.target/arm/pac-14.c | 2 +-
>  gcc/testsuite/gcc.target/arm/pac-15.c | 4 ++--
>  gcc/testsuite/gcc.target/arm/pac-2.c  | 4 +++-
>  gcc/testsuite/gcc.target/arm/pac-3.c  | 4 +++-
>  gcc/testsuite/gcc.target/arm/pac-4.c  | 4 +++-
>  gcc/testsuite/gcc.target/arm/pac-5.c  | 4 +++-
>  gcc/testsuite/gcc.target/arm/pac-6.c  | 4 +++-
>  gcc/testsuite/gcc.target/arm/pac-7.c  | 4 +++-
>  gcc/testsuite/gcc.target/arm/pac-8.c  | 4 +++-
>  gcc/testsuite/gcc.target/arm/pac-9.c  | 4 +++-
>  gcc/testsuite/lib/target-supports.exp | 2 +-
>  16 files changed, 39 insertions(+), 17 deletions(-)
> 
> diff --git a/gcc/testsuite/gcc.target/arm/pac-1.c 
> b/gcc/testsuite/gcc.target/arm/pac-1.c
> index e0eea0858e0..a2bec355214 100644
> --- a/gcc/testsuite/gcc.target/arm/pac-1.c
> +++ b/gcc/testsuite/gcc.target/arm/pac-1.c
> @@ -1,8 +1,10 @@
>  /* Testing return address signing.  */
>  /* { 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=pac-ret+leaf -mthumb -mfloat-abi=hard --save-temps -O0" } 
> */
> +/* { dg-options "-mbranch-protection=pac-ret+leaf -mfloat-abi=hard 
> --save-temps -O0" } */
> +/* { dg-add-options arm_arch_v8_1m_main_pacbti } */
>  
>  #include "pac.h"
>  
> diff --git a/gcc/testsuite/gcc.target/arm/pac-10.c 
> b/gcc/testsuite/gcc.target/arm/pac-10.c
> index 6da8434aeaf..0882dad7406 100644
> --- a/gcc/testsuite/gcc.target/arm/pac-10.c
> +++ b/gcc/testsuite/gcc.target/arm/pac-10.c
> @@ -1,7 +1,9 @@
>  /* Testing return address signing.  */
>  /* { dg-do compile } */
> +/* { dg-require-effective-target arm_arch_v8_1m_main_pacbti_ok } */
>  /* { dg-require-effective-target mbranch_protection_ok } */
> -/* { dg-options "-march=armv8.1-m.main+pacbti+fp -mbranch-protection=pac-ret 
> -mthumb -mfloat-abi=hard --save-temps -O0" } */
> +/* { dg-options "-mbranch-protection=pac-ret -mfloat-abi=hard --save-temps 
> -O0" } */
> +/* { dg-add-options arm_arch_v8_1m_main_pacbti } */
>  
>  #include "pac.h"
>  
> diff --git a/gcc/testsuite/gcc.target/arm/pac-11.c 
> b/gcc/testsuite/gcc.target/arm/pac-11.c
> index 0bb727c2c80..32685a726b7 100644
> --- a/gcc/testsuite/gcc.target/arm/pac-11.c
> +++ b/gcc/testsuite/gcc.target/arm/pac-11.c
> @@ -1,7 +1,9 @@
>  /* Testing return address signing.  */
>  /* { dg-do compile } */
> +/* { dg-require-effective-target arm_arch_v8_1m_main_pacbti_ok } */
>  /* { dg-require-effective-target mbranch_protection_ok } */
> -/* { dg-options "-march=armv8.1-m.main+pacbti+fp 
> -mbranch-protection=bti+pac-ret+leaf -mthumb -mfloat-abi=hard --save-temps 
> -O2" } */
> +/* { dg-options "-mbranch-protection=bti+pac-ret+leaf -mfloat-abi=hard 
> --save-temps -O2" } */
> +/* { dg-add-options arm_arch_v8_1m_main_pacbti } */
>  
>  #include "pac.h"
>  
> diff --git a/gcc/testsuite/gcc.target/arm/pac-12.c 
> b/gcc/testsuite/gcc.target/arm/pac-12.c
> index 6e1295c834d..37bf0047c2e 100644
> --- a/gcc/testsuite/gcc.target/arm/pac-12.c
> +++ b/gcc/testsuite/gcc.target/arm/pac-12.c
> @@ -2,6 +2,6 @@
>  /* { dg-do run } */
>  /* { dg-require-effective-target arm_pacbti_hw } */
>  /* { dg-skip-if "need fp instructions" { *-*-* } { "" } { "-mfloat-abi=hard" 
> } } */
> -/* { dg-options "-march=armv8.1-m.main+dsp+fp.dp+pacbti 
> -mbranch-protection=standard -mthumb -mfloat-abi=hard" } */
> +/* { dg-options "-mcpu=unset -march=armv8.1-m.main+dsp+fp.dp+pacbti 
> -mbranch-protection=standard -mthumb -mfloat-abi=hard" } */
>  
>  #include "pac.h"
> diff --git a/gcc/testsuite/gcc.target/arm/pac-13.c 
> b/gcc/testsuite/gcc.target/arm/pac-13.c
> index faf836b2026..971e67effa1 100644
> --- a/gcc/testsuite/gcc.target/arm/pac-13.c
> +++ b/gcc/testsuite/gcc.target/arm/pac-13.c
> @@ -2,6 +2,6 @@
>  /* { dg-do run } */
>  /* { dg-require-effective-target arm_pacbti_hw } */
>  /* { dg-skip-if "need fp instructions" { *-*-* } { "" } { "-mfloat-abi=hard" 
> } } */
> -/* { dg-options "-march=armv8.1-m.main+mve.fp+fp.dp+pacbti 
> -mbranch-protection=standard -mthumb -mfloat-abi=hard" } */
> +/* { dg-options "-mcpu=unset -march=armv8.1-m.main+mve.fp+fp.dp+pacbti 
> -mbranch-protection=standard -mthumb -mfloat-abi=hard" } */
>  
>  #include "pac.h"
> diff --git a/gcc/testsuite/gcc.target/arm/pac-14.c 
> b/gcc/testsuite/gcc.target/arm/pac-14.c
> index 51609b61c75..1b2caed09a0 100644
> --- a/gcc/testsuite/gcc.target/arm/pac-14.c
> +++ b/gcc/testsuite/gcc.target/arm/pac-14.c
> @@ -2,6 +2,6 @@
>  /* { dg-do run } */
>  /* { dg-require-effective-target arm_pacbti_hw } */
>  /* { dg-skip-if "need fp instructions" { *-*-* } { "" } { "-mfloat-abi=hard" 
> } } */
> -/* { dg-options "-march=armv8.1-m.main+mve+fp.dp+pacbti 
> -mbranch-protection=standard -mthumb -mfloat-abi=hard" } */
> +/* { dg-options "-mcpu=unset -march=armv8.1-m.main+mve+fp.dp+pacbti 
> -mbranch-protection=standard -mthumb -mfloat-abi=hard" } */
>  
>  #include "pac.h"
> diff --git a/gcc/testsuite/gcc.target/arm/pac-15.c 
> b/gcc/testsuite/gcc.target/arm/pac-15.c
> index 979941492d3..788c4062c76 100644
> --- a/gcc/testsuite/gcc.target/arm/pac-15.c
> +++ b/gcc/testsuite/gcc.target/arm/pac-15.c
> @@ -1,8 +1,8 @@
>  /* Check that GCC does .save and .cfi_offset directives with RA_AUTH_CODE 
> pseudo hard-register.  */
>  /* { dg-do compile } */
> +/* { dg-require-effective-target arm_arch_v8_1m_main_pacbti_ok } */
>  /* { dg-require-effective-target mbranch_protection_ok } */
> -/* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" 
> "-mcpu=*" } } */
> -/* { dg-options "-march=armv8.1-m.main+mve+pacbti 
> -mbranch-protection=pac-ret -mthumb -mfloat-abi=hard 
> -fasynchronous-unwind-tables -g -O0" } */
> +/* { dg-options "-mcpu=unset -march=armv8.1-m.main+mve+pacbti 
> -mbranch-protection=pac-ret -mthumb -mfloat-abi=hard 
> -fasynchronous-unwind-tables -g -O0" } */
>  
>  #include "stdio.h"
>  
> diff --git a/gcc/testsuite/gcc.target/arm/pac-2.c 
> b/gcc/testsuite/gcc.target/arm/pac-2.c
> index 5eb1062043c..6a4f84e766c 100644
> --- a/gcc/testsuite/gcc.target/arm/pac-2.c
> +++ b/gcc/testsuite/gcc.target/arm/pac-2.c
> @@ -1,8 +1,10 @@
>  /* Testing return address signing.  */
>  /* { 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=pac-ret 
> -mthumb -mfloat-abi=hard --save-temps -O0" } */
> +/* { dg-options "-mbranch-protection=pac-ret -mfloat-abi=hard --save-temps 
> -O0" } */
> +/* { dg-add-options arm_arch_v8_1m_main_pacbti } */
>  
>  #include "pac.h"
>  
> diff --git a/gcc/testsuite/gcc.target/arm/pac-3.c 
> b/gcc/testsuite/gcc.target/arm/pac-3.c
> index 50453dd8ec4..82a1d73258f 100644
> --- a/gcc/testsuite/gcc.target/arm/pac-3.c
> +++ b/gcc/testsuite/gcc.target/arm/pac-3.c
> @@ -1,8 +1,10 @@
>  /* Testing return address signing.  */
>  /* { 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 --save-temps 
> -O2" } */
> +/* { dg-options "-mbranch-protection=bti+pac-ret+leaf -mfloat-abi=hard 
> --save-temps -O2" } */
> +/* { dg-add-options arm_arch_v8_1m_main_pacbti } */
>  
>  #include "pac.h"
>  
> diff --git a/gcc/testsuite/gcc.target/arm/pac-4.c 
> b/gcc/testsuite/gcc.target/arm/pac-4.c
> index 81907079d77..3998ae7637f 100644
> --- a/gcc/testsuite/gcc.target/arm/pac-4.c
> +++ b/gcc/testsuite/gcc.target/arm/pac-4.c
> @@ -1,7 +1,9 @@
>  /* Testing return address signing.  */
>  /* { dg-do compile } */
> +/* { dg-require-effective-target arm_arch_v8_1m_main_pacbti_ok } */
>  /* { dg-require-effective-target mbranch_protection_ok } */
> -/* { dg-options "-march=armv8.1-m.main+pacbti+fp -mthumb -mfloat-abi=hard 
> --save-temps -O2" } */
> +/* { dg-options "-mfloat-abi=hard --save-temps -O2" } */
> +/* { dg-add-options arm_arch_v8_1m_main_pacbti } */
>  
>  #include "pac.h"
>  
> diff --git a/gcc/testsuite/gcc.target/arm/pac-5.c 
> b/gcc/testsuite/gcc.target/arm/pac-5.c
> index c70087eb6b6..98e298dfe39 100644
> --- a/gcc/testsuite/gcc.target/arm/pac-5.c
> +++ b/gcc/testsuite/gcc.target/arm/pac-5.c
> @@ -1,8 +1,10 @@
>  /* Testing return address signing.  */
>  /* { 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=pac-ret+leaf -mthumb -mfloat-abi=hard --save-temps -O0" } 
> */
> +/* { dg-options "-mbranch-protection=pac-ret+leaf -mfloat-abi=hard 
> --save-temps -O0" } */
> +/* { dg-add-options arm_arch_v8_1m_main_pacbti } */
>  
>  #include <stdlib.h>
>  
> diff --git a/gcc/testsuite/gcc.target/arm/pac-6.c 
> b/gcc/testsuite/gcc.target/arm/pac-6.c
> index a8e3067f825..2335aeee6a0 100644
> --- a/gcc/testsuite/gcc.target/arm/pac-6.c
> +++ b/gcc/testsuite/gcc.target/arm/pac-6.c
> @@ -1,7 +1,9 @@
>  /* Check that GCC does .save and .cfi_offset directives with RA_AUTH_CODE 
> pseudo hard-register.  */
>  /* { 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 
> -mthumb --save-temps -O0 -g" } */
> +/* { dg-options "-mbranch-protection=pac-ret+leaf --save-temps -O0 -g" } */
> +/* { dg-add-options arm_arch_v8_1m_main } */
>  
>  int i;
>  
> diff --git a/gcc/testsuite/gcc.target/arm/pac-7.c 
> b/gcc/testsuite/gcc.target/arm/pac-7.c
> index 6b4ad1450ce..dfffa78777f 100644
> --- a/gcc/testsuite/gcc.target/arm/pac-7.c
> +++ b/gcc/testsuite/gcc.target/arm/pac-7.c
> @@ -1,8 +1,10 @@
>  /* Testing return address signing.  */
>  /* { 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=pac-ret+leaf -mthumb -mfloat-abi=hard --save-temps -O0" } 
> */
> +/* { dg-options "-mbranch-protection=pac-ret+leaf -mfloat-abi=hard 
> --save-temps -O0" } */
> +/* { dg-add-options arm_arch_v8_1m_main_pacbti } */
>  
>  #include <stdlib.h>
>  
> diff --git a/gcc/testsuite/gcc.target/arm/pac-8.c 
> b/gcc/testsuite/gcc.target/arm/pac-8.c
> index 84208bfda4f..c1b418dd582 100644
> --- a/gcc/testsuite/gcc.target/arm/pac-8.c
> +++ b/gcc/testsuite/gcc.target/arm/pac-8.c
> @@ -1,8 +1,10 @@
>  /* Testing return address signing.  */
>  /* { 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=pac-ret+leaf -mthumb -mfloat-abi=hard --save-temps -O0" } 
> */
> +/* { dg-options "-mbranch-protection=pac-ret+leaf -mfloat-abi=hard 
> --save-temps -O0" } */
> +/* { dg-add-options arm_arch_v8_1m_main_pacbti } */
>  
>  #include <stdarg.h>
>  #include <stdlib.h>
> diff --git a/gcc/testsuite/gcc.target/arm/pac-9.c 
> b/gcc/testsuite/gcc.target/arm/pac-9.c
> index 588b7ffb8d2..afbddcd7d5f 100644
> --- a/gcc/testsuite/gcc.target/arm/pac-9.c
> +++ b/gcc/testsuite/gcc.target/arm/pac-9.c
> @@ -1,7 +1,9 @@
>  /* Testing return address signing.  */
>  /* { dg-do compile } */
> +/* { dg-require-effective-target arm_arch_v8_1m_main_pacbti_ok } */
>  /* { dg-require-effective-target mbranch_protection_ok } */
> -/* { dg-options "-march=armv8.1-m.main+pacbti+fp 
> -mbranch-protection=pac-ret+leaf -mthumb -mfloat-abi=hard --save-temps -O0" } 
> */
> +/* { dg-options "-mbranch-protection=pac-ret+leaf -mfloat-abi=hard 
> --save-temps -O0" } */
> +/* { dg-add-options arm_arch_v8_1m_main_pacbti } */
>  
>  #include "pac.h"
>  
> diff --git a/gcc/testsuite/lib/target-supports.exp 
> b/gcc/testsuite/lib/target-supports.exp
> index 0c2fd83f45c..01ed55ed82f 100644
> --- a/gcc/testsuite/lib/target-supports.exp
> +++ b/gcc/testsuite/lib/target-supports.exp
> @@ -6114,7 +6114,7 @@ proc check_effective_target_arm_pacbti_hw {} {
>         asm ("autg r12, lr, sp");
>         asm ("bx lr");
>       }
> -    } "-march=armv8.1-m.main+pacbti+fp -mbranch-protection=standard -mthumb 
> -mfloat-abi=hard"]
> +    } "-mcpu=unset -march=armv8.1-m.main+pacbti+fp 
> -mbranch-protection=standard -mthumb -mfloat-abi=hard"]
>  }
>  
>  # Return 1 if this compilation turns on string_ops_prefer_neon on.

Reply via email to