aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorbjörn SVENSSON <torbjorn.svensson@foss.st.com>2024-06-07 10:42:22 +0200
committerTorbjörn SVENSSON <torbjorn.svensson@foss.st.com>2024-06-12 10:12:07 +0200
commit9100e78ba28b1b69d1362d18088e897ca0f99594 (patch)
treed067d89b3f9db4a18911ece663967e654363cc8a
parenta657148995e1c46178637c8de82d1fab5474a37d (diff)
downloadgcc-9100e78ba28b1b69d1362d18088e897ca0f99594.zip
gcc-9100e78ba28b1b69d1362d18088e897ca0f99594.tar.gz
gcc-9100e78ba28b1b69d1362d18088e897ca0f99594.tar.bz2
testsuite: Fix expand-return CMSE test for Armv8.1-M [PR115253]
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.svensson@foss.st.com> Co-authored-by: Yvan ROUX <yvan.roux@foss.st.com> (cherry picked from commit cf5f9171bae1f5f3034dc9a055b77446962f1a8c)
-rw-r--r--gcc/testsuite/gcc.target/arm/cmse/extend-return.c62
1 files 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 081de0d..2288d166 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