]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.target/arm/cmse/baseline/cmse-13.c
ARMv8-M Security Extension's cmse_nonsecure_call: use __gnu_cmse_nonsecure_call
[thirdparty/gcc.git] / gcc / testsuite / gcc.target / arm / cmse / baseline / cmse-13.c
1 /* { dg-do compile } */
2 /* { dg-require-effective-target arm_arch_v8m_base_ok } */
3 /* { dg-add-options arm_arch_v8m_base } */
4 /* { dg-options "-mcmse" } */
5
6 int __attribute__ ((cmse_nonsecure_call)) (*bar) (float, double);
7
8 int
9 foo (int a)
10 {
11 return bar (1.0f, 2.0) + a + 1;
12 }
13
14 /* Checks for saving and clearing prior to function call. */
15 /* { dg-final { scan-assembler "lsrs\tr4, r4, #1" } } */
16 /* { dg-final { scan-assembler "lsls\tr4, r4, #1" } } */
17 /* { dg-final { scan-assembler-not "movs\tr0, r4" } } */
18 /* { dg-final { scan-assembler "\n\tmovs\tr1, r4" } } */
19 /* { dg-final { scan-assembler-not "\n\tmovs\tr2, r4\n\tmovs\tr3, r4" } } */
20 /* { dg-final { scan-assembler-not "vmov" } } */
21 /* { dg-final { scan-assembler-not "vmsr" } } */
22
23 /* Now we check that we use the correct intrinsic to call. */
24 /* { dg-final { scan-assembler "bl\t__gnu_cmse_nonsecure_call" } } */
25