| 1 |
// { dg-do compile } |
| 2 |
// { dg-additional-sources "imports/attributes.d" } |
| 3 |
|
| 4 |
import gcc.attributes; |
| 5 |
|
| 6 |
@value_ignored |
| 7 |
int f0() |
| 8 |
{ |
| 9 |
return 0; |
| 10 |
} |
| 11 |
|
| 12 |
@type_symbol // { dg-warning ".type_symbol. attribute has no effect" } |
| 13 |
int f1() |
| 14 |
{ |
| 15 |
return 1; |
| 16 |
} |
| 17 |
|
| 18 |
@template_symbol // { dg-warning ".template_symbol. attribute has no effect" } |
| 19 |
int f2() |
| 20 |
{ |
| 21 |
return 2; |
| 22 |
} |
| 23 |
|
| 24 |
@struct_wrong_field(123) // { dg-warning "unknown attribute .123." } |
| 25 |
int f3() |
| 26 |
{ |
| 27 |
return 3; |
| 28 |
} |
| 29 |
|
| 30 |
@struct_void_init() |
| 31 |
int f4() |
| 32 |
{ |
| 33 |
return 4; |
| 34 |
} |
| 35 |
|
| 36 |
@unknown_attribute() // { dg-warning "unknown attribute .made up name." } |
| 37 |
int f5() |
| 38 |
{ |
| 39 |
return 5; |
| 40 |
} |