PR tree-optimization/86401
[official-gcc.git] / gcc / testsuite / c-c++-common / Wduplicated-branches-12.c
blobcd746f1ad3090ae4c67925a9db21d6b989c66e17
1 /* PR c/64279 */
2 /* { dg-do compile } */
3 /* { dg-options "-Wduplicated-branches" } */
5 void
6 f (int i)
8 if (i) /* { dg-warning "this condition has identical branches" } */
9 return 0;
10 /* { dg-warning ".return. with a value" "" { target c } .-1 } */
11 /* { dg-error "return-statement with a value" "" { target c++ } .-2 } */
12 else
13 return 0;
14 /* { dg-warning ".return. with a value" "" { target c } .-1 } */
15 /* { dg-error "return-statement with a value" "" { target c++ } .-2 } */