annotate gcc/testsuite/gcc.dg/uninit-18.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* { dg-do compile } */
kono
parents:
diff changeset
2 /* { dg-options "-O -Wuninitialized" } */
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 char *foo(int bar, char *baz)
kono
parents:
diff changeset
5 {
kono
parents:
diff changeset
6 char *tmp;
kono
parents:
diff changeset
7
kono
parents:
diff changeset
8 if (bar & 3)
kono
parents:
diff changeset
9 tmp = baz;
kono
parents:
diff changeset
10
kono
parents:
diff changeset
11 switch (bar) {
kono
parents:
diff changeset
12 case 1:
kono
parents:
diff changeset
13 tmp[5] = 7; /* { dg-bogus "may be used uninitialized" } */
kono
parents:
diff changeset
14 break;
kono
parents:
diff changeset
15 case 2:
kono
parents:
diff changeset
16 tmp[11] = 15; /* { dg-bogus "may be used uninitialized" } */
kono
parents:
diff changeset
17 break;
kono
parents:
diff changeset
18 default:
kono
parents:
diff changeset
19 tmp = 0;
kono
parents:
diff changeset
20 break;
kono
parents:
diff changeset
21 }
kono
parents:
diff changeset
22
kono
parents:
diff changeset
23 return tmp; /* { dg-bogus "may be used uninitialized" } */
kono
parents:
diff changeset
24 }