repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
* ubsan.c (ubsan_expand_null_ifn): Use _v1 suffixed type mismatch
[official-gcc.git]
/
gcc
/
testsuite
/
c-c++-common
/
Wimplicit-fallthrough-13.c
blob
f3ec79f975663de511ad4d799f16ced47a66d590
1
/* PR c/7652 */
2
/* { dg-do compile } */
3
/* { dg-options "-Wimplicit-fallthrough" } */
4
5
/* As per <http://security.coverity.com/blog/2013/Sep/gimme-a-break.html>, don't
6
warn for terminated branches (fall through to break / end of the switch). */
7
8
extern
void
bar
(
int
);
9
10
void
11
f
(
int
i
)
12
{
13
switch
(
i
)
14
{
15
case
1
:
16
bar
(
1
);
17
default
:
18
return
;
19
}
20
21
switch
(
i
)
22
{
23
case
1
:
24
bar
(
1
);
25
default
:
26
goto
X
;
27
}
28
X
:
29
30
switch
(
i
)
31
{
32
case
1
:
33
bar
(
1
);
34
default
:
35
break
;
36
}
37
38
switch
(
i
)
39
{
40
case
1
:
41
bar
(
1
);
42
case
2
:
43
case
3
:
44
default
:
45
break
;
46
}
47
48
switch
(
i
)
49
{
50
case
1
:
51
bar
(
1
);
52
default
:;
53
}
54
55
switch
(
i
)
56
{
57
case
1
:
58
bar
(
1
);
59
case
2
:
60
case
3
:
61
default
:;
62
}
63
}