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
Create embedded-5_0-branch branch for development on ARM embedded cores.
[official-gcc.git]
/
embedded-5_0-branch
/
gcc
/
testsuite
/
gcc.target
/
i386
/
mpx
/
union-arg-1-nov.c
blob
f96689f479a2bc837ab0d11a05d37274aa050f85
1
/* { dg-do run } */
2
/* { dg-options "-fcheck-pointer-bounds -mmpx" } */
3
4
5
#include
"mpx-check.h"
6
7
struct
s1
8
{
9
union
{
10
int
i1
;
11
int
i3
;
12
}
v
;
13
int
i2
;
14
union
{
15
int
*
p
;
16
int
p2
;
17
}
u
;
18
}
s1
;
19
20
int
rd
(
struct
s1 s
)
21
{
22
int
res
=
s
.
u
.
p
[
s
.
v
.
i1
+
s
.
i2
];
23
printf
(
"%d
\n
"
,
res
);
24
return
res
;
25
}
26
27
int
buf
[
100
];
28
int
buf1
[
10
];
29
30
int
mpx_test
(
int
argc
,
const char
**
argv
)
31
{
32
struct
s1 s
;
33
s
.
u
.
p
=
buf
;
34
s
.
v
.
i1
=
50
;
35
s
.
i2
= -
50
;
36
37
rd
(
s
);
38
39
s
.
v
.
i1
=
50
;
40
s
.
i2
=
49
;
41
42
rd
(
s
);
43
44
return
0
;
45
}