]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.target/arm/cmse/mainline/softfp-sp/cmse-8.c
ARMv8-M Security Extension's cmse_nonsecure_call: use __gnu_cmse_nonsecure_call
[thirdparty/gcc.git] / gcc / testsuite / gcc.target / arm / cmse / mainline / softfp-sp / cmse-8.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=soft" -mfloat-abi=hard } {""} } */
5 /* { dg-skip-if "Skip these if testing double precision" {*-*-*} {"-mfpu=fpv[4-5]-d16"} {""} } */
6 /* { dg-options "-mcmse -mfloat-abi=softfp -mfpu=fpv5-sp-d16" } */
7
8 int __attribute__ ((cmse_nonsecure_call)) (*bar) (double);
9
10 int
11 foo (int a)
12 {
13 return bar (2.0) + a + 1;
14 }
15
16 /* Checks for saving and clearing prior to function call. */
17 /* { dg-final { scan-assembler "lsrs\tr4, r4, #1" } } */
18 /* { dg-final { scan-assembler "lsls\tr4, r4, #1" } } */
19 /* { dg-final { scan-assembler-not "mov\tr0, r4" } } */
20 /* { dg-final { scan-assembler-not "mov\tr1, r4" } } */
21 /* { dg-final { scan-assembler "mov\tr2, r4" } } */
22 /* { dg-final { scan-assembler "mov\tr3, r4" } } */
23
24 /* Now we check that we use the correct intrinsic to call. */
25 /* { dg-final { scan-assembler "bl\t__gnu_cmse_nonsecure_call" } } */