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
/
return-pointer-1-nov.c
blob
62d05013909a823c256fcb866841e6b11d394f48
1
/* { dg-do run } */
2
/* { dg-options "-fcheck-pointer-bounds -mmpx" } */
3
4
5
#include
"mpx-check.h"
6
7
int
*
_buf1
[
100
];
8
int
_buf2
[
100
];
9
10
int
**
get_buf1
()
11
{
12
return
_buf1
;
13
}
14
15
int
*
get_buf2
()
16
{
17
return
_buf2
;
18
}
19
20
void
wr
(
int
i
,
int
**
buf1
,
int
*
buf2
)
21
{
22
buf1
[
i
] =
buf2
;
23
}
24
25
int
rd
(
int
i
,
int
j
,
int
**
buf
)
26
{
27
int
res
=
buf
[
i
][
j
];
28
printf
(
"%d
\n
"
,
res
);
29
return
res
;
30
}
31
32
int
mpx_test
(
int
argc
,
const char
**
argv
)
33
{
34
int
**
buf1
=
get_buf1
();
35
int
*
buf2
=
get_buf2
();
36
wr
(
10
,
buf1
,
buf2
);
37
rd
(
10
,
0
,
buf1
);
38
rd
(
10
,
99
,
buf1
);
39
40
return
0
;
41
}