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
/
struct-copy-2-nov.c
blob
01f5b679faf1ab01ddb1e4afd7324684324b1f35
1
/* { dg-do run } */
2
/* { dg-options "-fcheck-pointer-bounds -mmpx" } */
3
4
5
#include
"mpx-check.h"
6
7
struct
S
{
8
int
a
;
9
int
b
[
100
];
10
int
c
;
11
}
S
;
12
13
int
foo
(
void
*
p
,
int
k
)
14
{
15
struct
S
*
s
= (
struct
S
*)
p
;
16
int
res
=
s
->
b
[
k
];
17
printf
(
"%d
\n
"
,
res
);
18
return
res
;
19
}
20
21
int
mpx_test
(
int
argc
,
const char
**
argv
)
22
{
23
struct
S s
;
24
25
foo
(&
s
.
a
,
0
);
26
foo
(&
s
.
a
,
99
);
27
28
return
0
;
29
}