]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.target/arm/cmse/mainline/soft/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 / mainline / soft / cmse-13.c
1 /* { dg-do compile } */
2 /* { dg-require-effective-target arm_arch_v8m_main_ok } */
3 /* { dg-add-options arm_arch_v8m_main } */
4 /* { dg-skip-if "Do not combine float-abi= hard | soft | softfp" {*-*-*} {"-mfloat-abi=hard" -mfloat-abi=softfp } {""} } */
5 /* { dg-options "-mcmse -mfloat-abi=soft" } */
6
7 int __attribute__ ((cmse_nonsecure_call)) (*bar) (float, double);
8
9 int
10 foo (int a)
11 {
12 return bar (1.0f, 2.0) + a + 1;
13 }
14
15 /* Checks for saving and clearing prior to function call. */
16 /* { dg-final { scan-assembler "lsrs\tr4, r4, #1" } } */
17 /* { dg-final { scan-assembler "lsls\tr4, r4, #1" } } */
18 /* { dg-final { scan-assembler-not "mov\tr0, r4" } } */
19 /* { dg-final { scan-assembler "mov\tr1, r4" } } */
20 /* { dg-final { scan-assembler-not "mov\tr2, r4" } } */
21 /* { dg-final { scan-assembler-not "mov\tr3, r4" } } */
22 /* { dg-final { scan-assembler-not "vmov" } } */
23 /* { dg-final { scan-assembler-not "vmsr" } } */
24
25 /* Now we check that we use the correct intrinsic to call. */
26 /* { dg-final { scan-assembler "bl\t__gnu_cmse_nonsecure_call" } } */
27