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
/
reference-2-nov.cpp
blob
cdd927c891ef90e51be4d8f00b9179d79ff535d2
1
/* { dg-do run } */
2
/* { dg-options "-fcheck-pointer-bounds -mmpx" } */
3
4
5
#include
"mpx-check.h"
6
7
int
buf
[
100
];
8
9
int
__attribute
((
nothrow
))
10
rd
(
int
*&
p
,
int
i
)
11
{
12
int
res
=
p
[
i
];
13
printf
(
"%d
\n
"
,
res
);
14
return
res
;
15
}
16
17
void
set_p
(
int
*&
ref
)
18
{
19
ref
=
buf
;
20
}
21
22
int
mpx_test
(
int
argc
,
const char
**
argv
)
23
{
24
int
*
p
;
25
26
set_p
(
p
);
27
rd
(
p
,
0
);
28
rd
(
p
,
99
);
29
30
return
0
;
31
}