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
/
if-stmt-2-ubv.c
blob
3047f7b51041124a3532f40e9fc9e5c8988d08c7
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
*
p1
,
int
*
p2
,
int
i
)
11
{
12
int
res
;
13
14
if
(
p1
>
p2
)
15
p1
=
p2
;
16
17
res
=
p1
[
i
];
18
printf
(
"%d
\n
"
,
res
);
19
return
res
;
20
}
21
22
int
buf
[
100
];
23
24
int
mpx_test
(
int
argc
,
const char
**
argv
)
25
{
26
int
*
p
=
__bnd_set_ptr_bounds
(
buf
+
1
,
40
);
27
rd
(
buf
,
p
,
100
);
28
29
return
0
;
30
}