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
/
bitfields-1-lbv.c
blob
deca6fd6a97bc81f6b3368d3bc22b85a5597e35a
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
s
{
11
int
a
;
12
int
b
:
10
;
13
int
c
:
1
;
14
int
e
:
10
;
15
}
s
;
16
17
#define HH (unsigned char)1
18
19
int
foo
(
struct
s
*
p
)
20
{
21
int
val
=
p
->
b
;
22
printf
(
"%d
\n
"
,
val
);
23
return
val
==
HH
;
24
}
25
26
int
mpx_test
(
int
argc
,
const char
**
argv
)
27
{
28
struct
s buf
[
100
];
29
30
foo
(
buf
-
1
);
31
32
return
0
;
33
}