ARM target supports ARMv8-M Security Extensions, enabled by the @code{-mcmse}
option.
+@item arm_cmse_hw
+Test system supports executing CMSE instructions.
+
@item arm_coproc1_ok
@anchor{arm_coproc1_ok}
ARM target supports the following coprocessor instructions: @code{CDP},
-/* { dg-do run } */
+/* This test is executed only if the execution engine supports CMSE instructions. */
/* { dg-options "--save-temps -mcmse -Wl,--section-start,.gnu.sgstubs=0x00400000" } */
typedef struct
-/* { dg-do run } */
+/* This test is executed only if the execution engine supports CMSE instructions. */
/* { dg-options "--save-temps -mcmse -Wl,--section-start,.gnu.sgstubs=0x00400000" } */
typedef struct
-/* { dg-do run } */
+/* This test is executed only if the execution engine supports CMSE instructions. */
/* { dg-options "--save-temps -mcmse -Wl,--section-start,.gnu.sgstubs=0x00400000" } */
typedef struct
-/* { dg-do run } */
+/* This test is executed only if the execution engine supports CMSE instructions. */
+/* Note that it "passes" on qemu-arm while it shouldn't because that simulator
+ does not model secure memory: it's better to skip it in this case, and rely
+ on do-what-default as set in cmse.exp. (It works as expected with
+ qemu-system-mode). */
/* { dg-options "-Os -mcmse" } */
#include <arm_cmse.h>
dg-init
set saved-dg-do-what-default ${dg-do-what-default}
-set dg-do-what-default "assemble"
+
+if {[is-effective-target arm_cmse_hw]} then {
+ set dg-do-what-default run
+} else {
+ set dg-do-what-default assemble
+}
set saved-lto_torture_options ${LTO_TORTURE_OPTIONS}
set LTO_TORTURE_OPTIONS ""
-/* { dg-do run } */
+/* This test is executed only if the execution engine supports CMSE instructions. */
/* { dg-options "--save-temps -mcmse -Wl,--section-start,.gnu.sgstubs=0x00400000" } */
typedef struct
} "-mcmse"];
}
+# Return 1 if the target supports executing CMSE instructions, 0
+# otherwise. Cache the result.
+
+proc check_effective_target_arm_cmse_hw { } {
+ return [check_runtime arm_cmse_hw_available {
+ int __attribute__ ((cmse_nonsecure_entry)) ns_func(void)
+ {
+ return 0;
+ }
+ int main (void)
+ {
+ return ns_func();
+ }
+ } "-mcmse -Wl,--section-start,.gnu.sgstubs=0x00400000"]
+}
# Return 1 if the target supports executing MVE instructions, 0
# otherwise.