| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-mcmse" } */ |
| 3 |
|
| 4 |
struct span { |
| 5 |
int a, b; |
| 6 |
}; |
| 7 |
|
| 8 |
extern int qux (void); |
| 9 |
|
| 10 |
void __attribute__ ((cmse_nonsecure_entry)) |
| 11 |
foo (void) {} |
| 12 |
|
| 13 |
static void __attribute__ ((cmse_nonsecure_entry)) |
| 14 |
bar (void) {} /* { dg-warning "has no effect on functions with static linkage" } */ |
| 15 |
|
| 16 |
int __attribute__ ((cmse_nonsecure_entry)) |
| 17 |
baz (void) |
| 18 |
{ |
| 19 |
return qux (); |
| 20 |
} |
| 21 |
|
| 22 |
void __attribute__ ((cmse_nonsecure_call)) |
| 23 |
quux (void) {} /* { dg-warning "attribute only applies to base type of a function pointer" } */ |
| 24 |
|
| 25 |
int __attribute__ ((cmse_nonsecure_call)) norf; /* { dg-warning "attribute only applies to base type of a function pointer" } */ |
| 26 |
|
| 27 |
/* { dg-final { scan-assembler-times "bxns" 2 } } */ |
| 28 |
/* { dg-final { scan-assembler "foo:" } } */ |
| 29 |
/* { dg-final { scan-assembler "__acle_se_foo:" } } */ |
| 30 |
/* { dg-final { scan-assembler-not "__acle_se_bar:" } } */ |
| 31 |
/* { dg-final { scan-assembler "baz:" } } */ |
| 32 |
/* { dg-final { scan-assembler "__acle_se_baz:" } } */ |
| 33 |
/* { dg-final { scan-assembler-not "__acle_se_quux:" } } */ |
| 34 |
/* { dg-final { scan-assembler-not "__acle_se_norf:" } } */ |