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 c/64279
[official-gcc.git]
/
gcc
/
testsuite
/
c-c++-common
/
Wduplicated-branches-7.c
blob
03721dc4cb632292fcf2576f761b44f5e548f9f8
1
/* PR c/64279 */
2
/* { dg-do compile } */
3
/* { dg-options "-Wduplicated-branches" } */
4
5
struct
S
6
{
7
int
x
;
8
}
s
;
9
int
a
[
10
];
10
11
#define XMEM(R) ((R).x)
12
#define XSTR(R) ((R).x)
13
14
void
15
f
(
int
i
)
16
{
17
if
(
i
)
18
XMEM
(
s
) =
1
;
19
else
20
XSTR
(
s
) =
1
;
21
22
if
(
i
)
/* { dg-warning "this condition has identical branches" } */
23
s
.
x
=
1
;
24
else
25
s
.
x
=
1
;
26
27
if
(
i
)
28
XMEM
(
s
) =
1
;
29
else
30
s
.
x
=
1
;
31
32
if
(
i
)
33
s
.
x
=
1
;
34
else
35
XMEM
(
s
) =
1
;
36
}