| 1 |
// Test whether attributes are accepted both immediately after |
| 2 |
// struct/union keyword and after the closing brace. |
| 3 |
// { dg-do compile } |
| 4 |
|
| 5 |
struct foo |
| 6 |
{ |
| 7 |
union __attribute__ ((packed)) |
| 8 |
{ |
| 9 |
int a; |
| 10 |
long b; |
| 11 |
}; |
| 12 |
union __attribute__ ((packed)) __attribute__ ((unused)) |
| 13 |
{ |
| 14 |
int c; |
| 15 |
long d; |
| 16 |
}; |
| 17 |
}; |
| 18 |
|
| 19 |
union __attribute__ ((packed)) bar |
| 20 |
{ |
| 21 |
int c; |
| 22 |
long d; |
| 23 |
}; |
| 24 |
|
| 25 |
struct __attribute__ ((packed)) baz |
| 26 |
{ |
| 27 |
int e; |
| 28 |
long f; |
| 29 |
}; |
| 30 |
|
| 31 |
struct foo2 |
| 32 |
{ |
| 33 |
union |
| 34 |
{ |
| 35 |
int a; |
| 36 |
long b; |
| 37 |
} __attribute__ ((packed)); |
| 38 |
}; |
| 39 |
|
| 40 |
union bar2 |
| 41 |
{ |
| 42 |
int c; |
| 43 |
long d; |
| 44 |
} __attribute__ ((packed)); |
| 45 |
|
| 46 |
struct baz2 |
| 47 |
{ |
| 48 |
int e; |
| 49 |
long f; |
| 50 |
} __attribute__ ((packed)); |