comparison gcc/testsuite/c-c++-common/Wduplicated-branches-3.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
comparison
equal deleted inserted replaced
68:561a7518be6b 111:04ced10e8804
1 /* PR c/64279 */
2 /* { dg-do compile } */
3 /* { dg-options "-Wduplicated-branches" } */
4
5 extern int *g;
6
7 void
8 f (short int i)
9 {
10 if (i == 0) /* { dg-warning "this condition has identical branches" } */
11 *g = (int) i;
12 else
13 *g = (int) i;
14
15 if (i == 1)
16 *g = (unsigned char) i;
17 else
18 *g = (signed char) i;
19 }