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-ubv.c
blob
a20a7897fce2b33e0f57b3be7da5543f1791c037
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
+
100
);
31
32
return
0
;
33
}