| 1 |
/* Test various erroneous or ignored uses of C23 attribute syntax. */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
/* { dg-options "-fgnu-tm" } */ |
| 4 |
|
| 5 |
void |
| 6 |
f1 (void) |
| 7 |
{ |
| 8 |
__transaction_atomic [[outer()]] {} /* { dg-error "does not take any arguments" } */ |
| 9 |
} |
| 10 |
|
| 11 |
void |
| 12 |
f2 (void) |
| 13 |
{ |
| 14 |
__transaction_atomic [[not_a_tm_attribute]] {} /* { dg-warning "attribute directive ignored" } */ |
| 15 |
} |
| 16 |
|
| 17 |
void |
| 18 |
f3 (void) |
| 19 |
{ |
| 20 |
__transaction_atomic [[unknown_attribute(args of *unknown* attributes need only (be {balanced[(({{[[]]}}))]}!), as per standard C)]] {} /* { dg-warning "attribute directive ignored" } */ |
| 21 |
} |
| 22 |
|
| 23 |
void |
| 24 |
f4 (void) |
| 25 |
{ |
| 26 |
__transaction_atomic [[gnu::const]] {} /* { dg-warning "attribute directive ignored" } */ |
| 27 |
} |
| 28 |
|
| 29 |
void |
| 30 |
f5 (void) |
| 31 |
{ |
| 32 |
__transaction_atomic [[bad_namespace::outer]] {} /* { dg-warning "attribute directive ignored" } */ |
| 33 |
} |
| 34 |
|
| 35 |
void |
| 36 |
f6 (void) |
| 37 |
{ |
| 38 |
__transaction_atomic [[outer, outer]] {} /* { dg-warning "attribute duplicated" } */ |
| 39 |
} |