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-4-lbv.cpp
blob
2442c6a4a9a094f66a18ec6c94d637bfa6e12540
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
int
buf
[
100
];
11
12
int
rd
(
int
(&
p
)[
100
],
int
i
)
13
{
14
int
res
=
p
[
i
];
15
printf
(
"%d
\n
"
,
res
);
16
return
res
;
17
}
18
19
int
(&
get_buf
()) [
100
]
20
{
21
return
buf
;
22
}
23
24
int
mpx_test
(
int
argc
,
const char
**
argv
)
25
{
26
int
*
p
;
27
28
rd
(
get_buf
(), -
1
);
29
30
return
0
;
31
}