| 1 |
/* Test TI ABI unsupported constructs */ |
| 2 |
|
| 3 |
/* { dg-do assemble } */ |
| 4 |
/* { dg-options "-O1 -mabi=ti" } */ |
| 5 |
|
| 6 |
struct s1 { |
| 7 |
void (*f)(void); |
| 8 |
int a; |
| 9 |
}; |
| 10 |
|
| 11 |
struct s2 { |
| 12 |
union { |
| 13 |
void (*f)(void); |
| 14 |
int a; |
| 15 |
long b; |
| 16 |
} u; |
| 17 |
}; |
| 18 |
|
| 19 |
int test1(struct s1 *p) |
| 20 |
{ |
| 21 |
return p->a; /* { dg-error "function pointers not supported with '-mabi=ti' option" } */ |
| 22 |
return 1; |
| 23 |
} |
| 24 |
|
| 25 |
int test1_unused_arg(struct s1 p, int a) |
| 26 |
{ /* { dg-error "function pointers not supported with '-mabi=ti' option" } */ |
| 27 |
return a; |
| 28 |
} |
| 29 |
|
| 30 |
int test2(struct s2 v) |
| 31 |
{ /* { dg-error "function pointers not supported with '-mabi=ti' option" } */ |
| 32 |
return 2; |
| 33 |
} |