Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/c-c++-common/Wimplicit-fallthrough-16.c @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children |
rev | line source |
---|---|
111 | 1 /* PR c/7652 */ |
2 /* { dg-do compile } */ | |
3 /* { dg-options "-Wimplicit-fallthrough" } */ | |
4 | |
5 /* Another nested switch, and with an initialization on top. Check that | |
6 we do warn here. */ | |
7 | |
8 void | |
9 f (int i) | |
10 { | |
11 switch (i) | |
12 { | |
13 case 1: | |
14 { | |
15 int t = 3; | |
16 switch (i) | |
17 { | |
18 case 3: | |
19 if (i > 5) | |
20 --i; | |
21 i += 10; /* { dg-warning "statement may fall through" } */ | |
22 case 4: | |
23 t /= 5; | |
24 break; | |
25 } | |
26 break; | |
27 } | |
28 case 2: | |
29 --i; | |
30 break; | |
31 } | |
32 } |