repo.or.cz
/
sdcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
struct / union in initializer, RFE #901.
[sdcc.git]
/
sdcc
/
support
/
regression
/
tests
/
bug-2539.c
blob
b702cd0e6ca80f4b945abe0f2fc52f77290c04bc
1
/*
2
bug-2539.c
3
*/
4
5
#include <testfwk.h>
6
7
#include <stdint.h>
8
9
struct
sBITS
{
10
unsigned
b0
:
1
;
11
unsigned
b1
:
1
;
12
unsigned
b2
:
1
;
13
unsigned
b3
:
1
;
14
unsigned
b4
:
1
;
15
unsigned
b5
:
1
;
16
unsigned
b6
:
1
;
17
unsigned
b7
:
1
;
18
};
19
struct
sBITS vb
;
20
21
void
SetIf
(
uint8_t
x
)
22
{
23
vb
.
b3
= (
x
!=
0
);
// only bit 0 of 'x' testet
24
}
25
26
void
testBug
(
void
)
27
{
28
SetIf
(
0
);
29
30
ASSERT
(!
vb
.
b3
);
31
32
SetIf
(
24
);
33
34
ASSERT
(
vb
.
b3
);
35
}
36