1// { dg-do compile } 2// { dg-options "-Wunused-label" } 3 4extern void f9(); 5 6void 7f1() 8{ 9 l1: f9(); // { dg-warning "not used" } 10 l3: ; f9(); // { dg-warning "not used" } 11 l4: __attribute__ ((unused)) ; f9(); 12} 13 14void 15f2() 16{ 17 label: __attribute ((unused)) ; 18} 19 20void 21f3() 22{ 23 // The next line would be OK in C but is a syntax error in C++. 24 l2: __attribute__ ((unused)) f9(); // { dg-error "expected" } 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} 29