Mercurial > hg > CbC > CbC_gcc
annotate 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 |
rev | line source |
---|---|
111 | 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 } |