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:07:30 +0200
commitcf5f9171bae1f5f3034dc9a055b77446962f1a8c (patch)
tree0894487a823e56703aec9cb1854a53a1812d6049
parent65bd0655ece268895e5018e393bafb769e201c78 (diff)
downloadgcc-cf5f9171bae1f5f3034dc9a055b77446962f1a8c.zip
gcc-cf5f9171bae1f5f3034dc9a055b77446962f1a8c.tar.gz
gcc-cf5f9171bae1f5f3034dc9a055b77446962f1a8c.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>
-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