| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-require-effective-target strub } */ |
| 3 |
|
| 4 |
int __attribute__ ((strub)) x; |
| 5 |
float __attribute__ ((strub)) f; |
| 6 |
double __attribute__ ((strub)) d; |
| 7 |
|
| 8 |
/* The attribute applies to the type of the declaration, i.e., to the pointer |
| 9 |
variable p, not to the pointed-to integer. */ |
| 10 |
int __attribute__ ((strub)) * |
| 11 |
p = &x; /* { dg-message "incompatible|invalid conversion" } */ |
| 12 |
|
| 13 |
typedef int __attribute__ ((strub)) strub_int; |
| 14 |
strub_int *q = &x; /* Now this is compatible. */ |
| 15 |
|
| 16 |
int __attribute__ ((strub)) |
| 17 |
a[2]; /* { dg-warning "does not apply to elements" } */ |
| 18 |
|
| 19 |
int __attribute__ ((vector_size (4 * sizeof (int)))) |
| 20 |
__attribute__ ((strub)) |
| 21 |
v; /* { dg-warning "does not apply to elements" } */ |
| 22 |
|
| 23 |
struct s { |
| 24 |
int i, j; |
| 25 |
} __attribute__ ((strub)) w; /* { dg-warning "does not apply to fields" } */ |