Skip to content

Commit 82a7ec6

Browse files
Adds regression test for bitfield naming bug
1 parent 651d8d1 commit 82a7ec6

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
typedef struct {
2+
unsigned char b11 : 1;
3+
unsigned char b22 : 1;
4+
unsigned char b34 : 2;
5+
unsigned char b58 : 4;
6+
} bf_t;
7+
8+
typedef union {
9+
unsigned char val;
10+
bf_t bf;
11+
} union_bf_t;
12+
13+
int main(void)
14+
{
15+
union_bf_t bf;
16+
bf.bf.b11 = 1;
17+
return 0;
18+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
CORE
2+
main.c
3+
--show-goto-functions --json-ui
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
BF1\{U8\}\$U8\$\'b11\'
7+
BF1\{U8\}\$U8\$\'b22\'
8+
BF2\{U8\}\$U8\$\'b34\'
9+
BF4\{U8\}\$U8\$\'b58\'
10+
--
11+
--
12+
13+
Checks that type2name generates the right names for structs containing bitfields,
14+
in particular including the width of bitfield fields.
15+

0 commit comments

Comments
 (0)