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
/
struct-arg-9-lbv.c
blob
acce18334adf635beaf935b6c5cd141a1f7ab93f
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
struct
s1
{
11
int
*
p
[
2
];
12
}
s1
;
13
14
int
rd
(
struct
s1 s
,
int
i
)
15
{
16
int
res
=
s
.
p
[
1
][
i
];
17
printf
(
"%d
\n
"
,
res
);
18
return
res
;
19
}
20
21
int
buf
[
100
];
22
int
buf1
[
100
];
23
24
int
mpx_test
(
int
argc
,
const char
**
argv
)
25
{
26
struct
s1 s
= { {
buf
,
buf1
} };
27
28
rd
(
s
, -
1
);
29
30
return
0
;
31
}