On 10/06/2024 15:04, Torbjörn SVENSSON wrote:
> For Armv8.1-M, the clearing of the registers is handled differently than
> for Armv8-M, so update the test case accordingly.
> 
> gcc/testsuite/ChangeLog:
> 
>       PR target/115253
>       * gcc.target/arm/cmse/extend-return.c: Update test case
>       condition for Armv8.1-M.
> 
> Signed-off-by: Torbjörn SVENSSON <torbjorn.svens...@foss.st.com>
> Co-authored-by: Yvan ROUX <yvan.r...@foss.st.com>
> ---
>  .../gcc.target/arm/cmse/extend-return.c       | 62 +++++++++++++++++--
>  1 file changed, 56 insertions(+), 6 deletions(-)
> 
> diff --git a/gcc/testsuite/gcc.target/arm/cmse/extend-return.c 
> b/gcc/testsuite/gcc.target/arm/cmse/extend-return.c
> index 081de0d699f..2288d166bd3 100644
> --- a/gcc/testsuite/gcc.target/arm/cmse/extend-return.c
> +++ b/gcc/testsuite/gcc.target/arm/cmse/extend-return.c
> @@ -1,5 +1,7 @@
>  /* { dg-do compile } */
>  /* { dg-options "-mcmse -fshort-enums" } */
> +/* ARMv8-M expectation with target { ! arm_cmse_clear_ok }.  */
> +/* ARMv8.1-M expectation with target arm_cmse_clear_ok.  */
>  /* { dg-final { check-function-bodies "**" "" "" } } */
>  
>  #include <arm_cmse.h>
> @@ -20,7 +22,15 @@ typedef enum offset __attribute__ ((cmse_nonsecure_call)) 
> ns_enum_foo_t (void);
>  typedef bool __attribute__ ((cmse_nonsecure_call)) ns_bool_foo_t (void);
>  
>  /*
> -**unsignNonsecure0:
> +**unsignNonsecure0:  { target arm_cmse_clear_ok }
> +**   ...
> +**   blxns   r[0-3]
> +**   ...
> +**   uxtb    r0, r0
> +**   ...
> +*/
> +/*
> +**unsignNonsecure0: { target { ! arm_cmse_clear_ok } }
>  **   ...
>  **   bl      __gnu_cmse_nonsecure_call
>  **   uxtb    r0, r0
> @@ -32,7 +42,15 @@ unsigned char unsignNonsecure0 (ns_unsign_foo_t * ns_foo_p)
>  }
>  
>  /*
> -**signNonsecure0:
> +**signNonsecure0:  { target arm_cmse_clear_ok }
> +**   ...
> +**   blxns   r[0-3]
> +**   ...
> +**   sxtb    r0, r0
> +**   ...
> +*/
> +/*
> +**signNonsecure0: { target { ! arm_cmse_clear_ok } }
>  **   ...
>  **   bl      __gnu_cmse_nonsecure_call
>  **   sxtb    r0, r0
> @@ -44,7 +62,15 @@ signed char signNonsecure0 (ns_sign_foo_t * ns_foo_p)
>  }
>  
>  /*
> -**shortUnsignNonsecure0:
> +**shortUnsignNonsecure0:  { target arm_cmse_clear_ok }
> +**   ...
> +**   blxns   r[0-3]
> +**   ...
> +**   uxth    r0, r0
> +**   ...
> +*/
> +/*
> +**shortUnsignNonsecure0: { target { ! arm_cmse_clear_ok } }
>  **   ...
>  **   bl      __gnu_cmse_nonsecure_call
>  **   uxth    r0, r0
> @@ -56,7 +82,15 @@ unsigned short shortUnsignNonsecure0 
> (ns_short_unsign_foo_t * ns_foo_p)
>  }
>  
>  /*
> -**shortSignNonsecure0:
> +**shortSignNonsecure0:  { target arm_cmse_clear_ok }
> +**   ...
> +**   blxns   r[0-3]
> +**   ...
> +**   sxth    r0, r0
> +**   ...
> +*/
> +/*
> +**shortSignNonsecure0: { target { ! arm_cmse_clear_ok } }
>  **   ...
>  **   bl      __gnu_cmse_nonsecure_call
>  **   sxth    r0, r0
> @@ -68,7 +102,15 @@ signed short shortSignNonsecure0 (ns_short_sign_foo_t * 
> ns_foo_p)
>  }
>  
>  /*
> -**enumNonsecure0:
> +**enumNonsecure0:  { target arm_cmse_clear_ok }
> +**   ...
> +**   blxns   r[0-3]
> +**   ...
> +**   uxtb    r0, r0
> +**   ...
> +*/
> +/*
> +**enumNonsecure0: { target { ! arm_cmse_clear_ok } }
>  **   ...
>  **   bl      __gnu_cmse_nonsecure_call
>  **   uxtb    r0, r0
> @@ -80,7 +122,15 @@ unsigned char __attribute__((noipa)) enumNonsecure0 
> (ns_enum_foo_t * ns_foo_p)
>  }
>  
>  /*
> -**boolNonsecure0:
> +**boolNonsecure0:  { target arm_cmse_clear_ok }
> +**   ...
> +**   blxns   r[0-3]
> +**   ...
> +**   uxtb    r0, r0
> +**   ...
> +*/
> +/*
> +**boolNonsecure0: { target { ! arm_cmse_clear_ok } }
>  **   ...
>  **   bl      __gnu_cmse_nonsecure_call
>  **   uxtb    r0, r0

OK when the nits in the first patch are sorted.

R.

Reply via email to