| 1 |
// { dg-do compile } |
| 2 |
// { dg-options "-Wunused-label" } |
| 3 |
|
| 4 |
extern void f9(); |
| 5 |
|
| 6 |
void |
| 7 |
f1() |
| 8 |
{ |
| 9 |
l1: f9(); // { dg-warning "not used" } |
| 10 |
l3: ; f9(); // { dg-warning "not used" } |
| 11 |
l4: __attribute__ ((unused)) ; f9(); |
| 12 |
} |
| 13 |
|
| 14 |
void |
| 15 |
f2() |
| 16 |
{ |
| 17 |
label: __attribute ((unused)) ; |
| 18 |
} |
| 19 |
|
| 20 |
void |
| 21 |
f3() |
| 22 |
{ |
| 23 |
// The next line would be OK in C but is a syntax error in C++. |
| 24 |
l2: __attribute__ ((unused)) f9(); // { dg-warning "ignored" } |
| 25 |
// We still get an unused label warning--this is |
| 26 |
// optional and can be removed if it ever changes. |
| 27 |
// { dg-warning "not used" "expected" { target *-*-* } 24 } |
| 28 |
} |