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