1 // { dg-do compile } 2 // { dg-options "-Wunused-label" } 3 4 extern void f9(); 5 6 void f1()7f1() 8 { 9 l1: f9(); // { dg-warning "not used" } 10 l3: ; f9(); // { dg-warning "not used" } 11 l4: __attribute__ ((unused)) ; f9(); 12 } 13 14 void f2()15f2() 16 { 17 label: __attribute ((unused)) ; 18 } 19 20 void f3()21f3() 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 } 29