repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git]
/
gcc
/
testsuite
/
gcc.dg
/
pr94963.c
blob
aca9e16130182384997e1b984cffd003cfe38c41
1
/* { dg-do compile } */
2
/* { dg-options "-O2 -Wall" } */
3
4
typedef
struct
5
{
6
int
p1
;
7
int
p2
;
8
int
p3
;
9
}
P
;
10
struct
S
11
{
12
int
field
;
13
};
14
extern
int
v2
;
15
extern
void
foo
(
struct
S
*
map
);
16
static struct
S var
;
17
const
P
*
pv
;
18
int
ps
;
19
void
20
f
(
void
)
21
{
22
if
(
pv
!=
0
)
23
for
(
const
P
*
ph
=
pv
;
ph
< &
pv
[
ps
]; ++
ph
)
24
switch
(
ph
->
p1
)
25
{
26
case
1
:
27
v2
=
ph
->
p2
;
28
break
;
29
case
2
:
30
var
.
field
=
ph
->
p3
;
31
break
;
32
}
33
if
(
var
.
field
!=
0
)
/* { dg-bogus "uninitialized" } */
34
foo
(&
var
);
35
}