2 /* { dg-do compile } */
3 /* { dg-options "-Wduplicated-cond" } */
11 extern int foo (void);
16 if (n
== 1) /* { dg-message "previously used here" } */
20 else if (n
== 1) /* { dg-warning "duplicated .if. condition" } */
65 if (n
== 1) /* { dg-message "previously used here" } */
67 else if (n
== 1) /* { dg-warning "duplicated .if. condition" } */
76 if (n
== -10) /* { dg-message "previously used here" } */
78 else if (n
== -10) /* { dg-warning "duplicated .if. condition" } */
87 struct S
{ long p
, q
; };
92 if (!s
->p
) /* { dg-message "previously used here" } */
94 else if (!s
->p
) /* { dg-warning "duplicated .if. condition" } */
102 if (n
) /* { dg-message "previously used here" } */
104 else if (n
) /* { dg-warning "duplicated .if. condition" } */
106 else if (n
) /* { dg-warning "duplicated .if. condition" } */
108 else if (n
) /* { dg-warning "duplicated .if. condition" } */
110 else if (n
) /* { dg-warning "duplicated .if. condition" } */
112 else if (n
) /* { dg-warning "duplicated .if. condition" } */
114 else if (n
) /* { dg-warning "duplicated .if. condition" } */
116 else if (n
) /* { dg-warning "duplicated .if. condition" } */
124 if (n
== 0) /* { dg-message "previously used here" } */
126 else if (n
== 1) /* { dg-message "previously used here" } */
128 else if (n
== 2) /* { dg-message "previously used here" } */
130 else if (n
== 3) /* { dg-message "previously used here" } */
132 else if (n
== 4) /* { dg-message "previously used here" } */
134 else if (n
== 5) /* { dg-message "previously used here" } */
136 else if (n
== 6) /* { dg-message "previously used here" } */
138 else if (n
== 7) /* { dg-message "previously used here" } */
140 else if (n
== 0) /* { dg-warning "duplicated .if. condition" } */
142 else if (n
== 1) /* { dg-warning "duplicated .if. condition" } */
144 else if (n
== 2) /* { dg-warning "duplicated .if. condition" } */
146 else if (n
== 3) /* { dg-warning "duplicated .if. condition" } */
148 else if (n
== 4) /* { dg-warning "duplicated .if. condition" } */
150 else if (n
== 5) /* { dg-warning "duplicated .if. condition" } */
152 else if (n
== 6) /* { dg-warning "duplicated .if. condition" } */
154 else if (n
== 7) /* { dg-warning "duplicated .if. condition" } */
162 if (!b
) /* { dg-message "previously used here" } */
164 else if (!b
) /* { dg-warning "duplicated .if. condition" } */
171 fn9 (int i
, int j
, int k
)
173 if (i
> 0 && j
> 0 && k
> 0) /* { dg-message "previously used here" } */
176 if (i
> 0 && j
> 0 && k
> 0) /* { dg-warning "duplicated .if. condition" } */