2 /* { dg-do compile } */
3 /* { dg-options "-Wduplicated-branches -O2" } */
15 if (i
> 10) /* { dg-warning "this condition has identical branches" } */
16 /* Optimizers can figure out that this is 1. */
27 if (i
== 0) /* { dg-warning "this condition has identical branches" } */
32 if (i
== 1) /* { dg-warning "this condition has identical branches" } */
42 if (i
== 2) /* { dg-warning "this condition has identical branches" } */
47 if (i
== 3) /* { dg-warning "this condition has identical branches" } */
52 if (i
== 4) /* { dg-warning "this condition has identical branches" } */
57 if (i
== 5) /* { dg-warning "this condition has identical branches" } */
78 if (i
== 6) /* { dg-warning "this condition has identical branches" } */
89 if (i
== 8) /* { dg-warning "this condition has identical branches" } */
95 if (i
== 9) /* { dg-warning "this condition has identical branches" } */
112 if (i
== 11) /* { dg-warning "this condition has identical branches" } */
121 if (i
== 12) /* { dg-warning "this condition has identical branches" } */
123 foo (6 + i
), foo (2);
127 foo (6 + i
), foo (2);
130 if (i
== 13) /* { dg-warning "this condition has identical branches" } */
135 if (i
== 14) /* { dg-warning "this condition has identical branches" } */
148 if (i
== 15) /* { dg-warning "this condition has identical branches" } */
151 p
+= (g
+ (1 + 1 + 1));
153 if (i
== 16) /* { dg-warning "this condition has identical branches" } */
158 if (i
== 17) /* { dg-warning "this condition has identical branches" } */
167 if (i
== 20) /* { dg-warning "this condition has identical branches" } */