1 /* PR c/7652 */ 2 /* { dg-do compile } */ 3 /* { dg-options "-Wimplicit-fallthrough" } */ 4 5 int f(int i)6f (int i) 7 { 8 switch (i) 9 { 10 case -1: 11 __attribute__((fallthrough)); 12 default: 13 __attribute__((fallthrough)); 14 case 1: 15 return 6; 16 case 2 ... 4: 17 __attribute__((fallthrough)); 18 case 5: 19 return 7; 20 } 21 return 0; 22 } 23 24 int g(int i)25g (int i) 26 { 27 switch (i) 28 { 29 case -1: 30 __attribute__((used)); /* { dg-warning "empty declaration|ignored" } */ 31 default: 32 __attribute__((used)); /* { dg-warning "empty declaration|ignored" } */ 33 case 1: 34 return 6; 35 case 2 ... 4: 36 __attribute__((used)); /* { dg-warning "empty declaration|ignored" } */ 37 case 5: 38 return 7; 39 } 40 return 0; 41 } 42