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
* gcc.dg/const-elim-1.c: xfail for xtensa.
[official-gcc.git]
/
gcc
/
testsuite
/
gcc.dg
/
pack-test-4.c
blob
27ae0cdcc77e5665c05d6662cfc41c21c6466955
1
/* PR c/11885
2
Bug: flag4 was allocated into the same byte as the other flags.
3
{ dg-options "" }
4
{ dg-do run } */
5
6
typedef
unsigned char uint8_t
;
7
8
typedef
struct
{
9
uint8_t
flag1
:
2
;
10
uint8_t
flag2
:
1
;
11
uint8_t
flag3
:
1
;
12
13
uint8_t
flag4
;
14
15
}
__attribute__
((
packed
))
MyType
;
16
17
int
main
(
void
)
18
{
19
MyType a
;
20
MyType
*
b
= &
a
;
21
22
b
->
flag1
=
0
;
23
b
->
flag2
=
0
;
24
b
->
flag3
=
0
;
25
26
b
->
flag4
=
0
;
27
28
b
->
flag4
++;
29
30
if
(
b
->
flag1
!=
0
)
31
abort
();
32
}