| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-mcmse" } */ |
| 3 |
|
| 4 |
struct span { |
| 5 |
int a, b; |
| 6 |
}; |
| 7 |
struct span2 { |
| 8 |
float a, b, c, d; |
| 9 |
}; |
| 10 |
|
| 11 |
union test_union |
| 12 |
{ |
| 13 |
long long a; |
| 14 |
int b; |
| 15 |
struct span2 c; |
| 16 |
} test_union; |
| 17 |
|
| 18 |
void __attribute__ ((cmse_nonsecure_entry)) |
| 19 |
foo (long long a, int b, long long c) {} /* { dg-error "not available to functions with arguments passed on the stack" } */ |
| 20 |
|
| 21 |
void __attribute__ ((cmse_nonsecure_entry)) |
| 22 |
bar (long long a, int b, struct span c) {} /* { dg-error "not available to functions with arguments passed on the stack" } */ |
| 23 |
|
| 24 |
void __attribute__ ((cmse_nonsecure_entry)) |
| 25 |
baz (int a, ...) {} /* { dg-error "not available to functions with variable number of arguments" } */ |
| 26 |
|
| 27 |
struct span __attribute__ ((cmse_nonsecure_entry)) |
| 28 |
qux (void) { /* { dg-error "not available to functions that return value on the stack" } */ |
| 29 |
struct span ret = {0, 0}; |
| 30 |
return ret; |
| 31 |
} |
| 32 |
|
| 33 |
void __attribute__ ((cmse_nonsecure_entry)) |
| 34 |
norf (struct span2 a) {} |
| 35 |
|
| 36 |
void __attribute__ ((cmse_nonsecure_entry)) |
| 37 |
foo2 (long long a, int b, union test_union c) {} /* { dg-error "not available to functions with arguments passed on the stack" } */ |
| 38 |
|
| 39 |
typedef void __attribute__ ((cmse_nonsecure_call)) bar2 (long long a, int b, long long c); /* { dg-error "not available to functions with arguments passed on the stack" } */ |
| 40 |
|
| 41 |
typedef void __attribute__ ((cmse_nonsecure_call)) baz2 (long long a, int b, struct span c); /* { dg-error "not available to functions with arguments passed on the stack" } */ |
| 42 |
|
| 43 |
typedef struct span __attribute__ ((cmse_nonsecure_call)) qux2 (void); /* { dg-error "not available to functions that return value on the stack" } */ |
| 44 |
|
| 45 |
typedef void __attribute__ ((cmse_nonsecure_call)) norf2 (int a, ...); /* { dg-error "not available to functions with variable number of arguments" } */ |