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-4-lbv.c
blob
c0666d389a1570d19d32f81c44cef168aa192bef
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
{
12
int
*
p
;
13
int
i1
;
14
int
i2
;
15
}
s1
;
16
17
int
rd
(
int
*
p1
,
int
*
p2
,
struct
s1 s
)
18
{
19
int
res
=
s
.
p
[
s
.
i1
+
s
.
i2
];
20
printf
(
"%d
\n
"
,
res
);
21
return
res
;
22
}
23
24
int
buf
[
100
];
25
int
buf1
[
10
];
26
27
int
mpx_test
(
int
argc
,
const char
**
argv
)
28
{
29
struct
s1 s
;
30
s
.
p
=
buf
;
31
s
.
i1
=
50
;
32
s
.
i2
= -
51
;
33
34
rd
(
buf1
,
buf1
,
s
);
35
36
return
0
;
37
}