Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/c-c++-common/Wduplicated-branches-4.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 extern const int *q; | |
7 | |
8 void | |
9 f (int i) | |
10 { | |
11 int j; | |
12 | |
13 if (i == 0) | |
14 for (j = 0; j < 10; j++) | |
15 ++*g; | |
16 else | |
17 for (j = 0; j < 10; j++) | |
18 ++*g; | |
19 | |
20 if (i == 1) | |
21 { | |
22 int i = 10; | |
23 *g = i; | |
24 } | |
25 else | |
26 { | |
27 int i = 10; | |
28 *g = i; | |
29 } | |
30 | |
31 if (i == 3) | |
32 q = (const int []){1}; | |
33 else | |
34 q = (const int []){1}; | |
35 } |