| 1 |
/* This test is executed only if the execution engine supports CMSE instructions. */ |
| 2 |
/* Note that it "passes" on qemu-arm while it shouldn't because that simulator |
| 3 |
does not model secure memory: it's better to skip it in this case, and rely |
| 4 |
on do-what-default as set in cmse.exp. (It works as expected with |
| 5 |
qemu-system-mode). */ |
| 6 |
/* { dg-options "-Os -mcmse" } */ |
| 7 |
|
| 8 |
#include <arm_cmse.h> |
| 9 |
|
| 10 |
int |
| 11 |
foo (void) |
| 12 |
{ |
| 13 |
return cmse_nonsecure_caller (); |
| 14 |
} |
| 15 |
|
| 16 |
int |
| 17 |
main (void) |
| 18 |
{ |
| 19 |
/* Return success (0) if main is secure, ie if cmse_nonsecure_caller/foo |
| 20 |
returns false (0). */ |
| 21 |
return foo (); |
| 22 |
} |