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
/
malloc-1-ubv.c
blob
6f48ec269237e98deec35403ed9f149d8cae2010
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
rd
(
int
*
p
,
int
i
)
11
{
12
int
res
=
p
[
i
];
13
printf
(
"%d
\n
"
,
res
);
14
return
res
;
15
}
16
17
int
mpx_test
(
int
argc
,
const char
**
argv
)
18
{
19
int
*
buf
= (
int
*)
malloc
(
100
*
sizeof
(
int
));
20
21
rd
(
buf
,
100
);
22
23
free
(
buf
);
24
25
return
0
;
26
}