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
PR middle-end/77674
[official-gcc.git]
/
gcc
/
testsuite
/
c-c++-common
/
Wimplicit-fallthrough-5.c
blob
9317484dbb25f4cf407599e78ea26121e90093ac
1
/* PR c/7652 */
2
/* { dg-do compile } */
3
/* { dg-options "-Wimplicit-fallthrough" } */
4
5
extern
void
bar
(
int
);
6
extern
void
die
(
void
)
__attribute__
((
noreturn
));
7
8
/* Test may_fallthru-ness. */
9
10
void
11
f
(
int
i
)
12
{
13
switch
(
i
)
14
{
15
case
1
:
16
bar
(
0
);
17
__attribute__
((
fallthrough
));
18
case
2
:;
19
}
20
21
switch
(
i
)
22
{
23
case
1
:
24
bar
(
0
);
25
return
;
26
case
2
:;
27
}
28
29
switch
(
i
)
30
{
31
case
1
:
32
bar
(
0
);
33
break
;
34
case
2
:;
35
}
36
37
switch
(
i
)
38
{
39
case
1
:
40
bar
(
0
);
41
goto
L1
;
42
L1
:
43
case
2
:;
44
}
45
46
switch
(
i
)
47
{
48
case
1
:
49
bar
(
0
);
50
die
();
51
case
2
:;
52
}
53
54
switch
(
i
)
55
{
56
case
1
:
57
{
58
int
i
,
j
,
k
;
59
bar
(
0
);
60
__attribute__
((
fallthrough
));
61
}
62
case
2
:;
63
}
64
65
switch
(
i
)
66
{
67
case
1
:
68
{
69
int
i
,
j
,
k
;
70
bar
(
0
);
71
return
;
72
}
73
case
2
:;
74
}
75
76
switch
(
i
)
77
{
78
case
1
:
79
{
80
int
i
,
j
,
k
;
81
bar
(
0
);
82
break
;
83
}
84
case
2
:;
85
}
86
87
switch
(
i
)
88
{
89
case
1
:
90
{
91
int
i
,
j
,
k
;
92
bar
(
0
);
93
goto
L2
;
94
}
95
L2
:
96
case
2
:;
97
}
98
99
switch
(
i
)
100
{
101
case
1
:
102
{
103
int
i
,
j
,
k
;
104
bar
(
0
);
105
die
();
106
}
107
case
2
:;
108
}
109
}