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
testsuite: Skip analyzer tests on AIX.
[official-gcc.git]
/
gcc
/
testsuite
/
c-c++-common
/
Wduplicated-cond-4.c
blob
4fb7e174848f9c69b9c5b8450f44efaac1bf4340
1
/* PR c/64249 */
2
/* { dg-do compile } */
3
/* { dg-options "-Wduplicated-cond" } */
4
/* Test we don't warn if a condition in an if-else-if chain
5
has a side-effect. E.g. __cxxabiv1::__cxa_end_catch ()
6
uses such a construction. */
7
8
extern
int
a
,
bar
(
void
);
9
10
int
11
fn1
(
void
)
12
{
13
if
(
a
)
14
return
1
;
15
else if
(
bar
())
16
return
2
;
17
else if
(
a
)
18
return
3
;
19
return
0
;
20
}
21
22
int
23
fn2
(
int
c
)
24
{
25
if
(
c
<
0
)
26
return
1
;
27
else if
(--
c
==
0
)
28
return
2
;
29
else if
(
c
<
0
)
30
return
3
;
31
return
0
;
32
}