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
PR c/64856
[official-gcc.git]
/
gcc
/
testsuite
/
gcc.dg
/
pack-test-4.c
blob
1ad8ee4fb000dbb1d6f33e680e4a50c4f49f5711
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
extern
void
abort
(
void
);
7
8
typedef
unsigned char uint8_t
;
9
10
typedef
struct
{
11
uint8_t
flag1
:
2
;
12
uint8_t
flag2
:
1
;
13
uint8_t
flag3
:
1
;
14
15
uint8_t
flag4
;
16
17
}
__attribute__
((
packed
))
MyType
;
18
19
int
main
(
void
)
20
{
21
MyType a
;
22
MyType
*
b
= &
a
;
23
24
b
->
flag1
=
0
;
25
b
->
flag2
=
0
;
26
b
->
flag3
=
0
;
27
28
b
->
flag4
=
0
;
29
30
b
->
flag4
++;
31
32
if
(
b
->
flag1
!=
0
)
33
abort
();
34
35
return
0
;
36
}