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
/
pointer-store-1-ubv.c
blob
4c8d45e003f242d8babff5fc125f2d8dbaf033d7
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
*
buf1
[
100
];
11
int
buf2
[
100
];
12
13
void
wr
(
int
i
)
14
{
15
buf1
[
i
] =
buf2
;
16
}
17
18
int
rd
(
int
i
,
int
j
)
19
{
20
int
res
=
buf1
[
i
][
j
];
21
printf
(
"%d
\n
"
,
res
);
22
return
res
;
23
}
24
25
int
mpx_test
(
int
argc
,
const char
**
argv
)
26
{
27
wr
(
10
);
28
rd
(
10
,
100
);
29
30
return
0
;
31
}