expressions: make assign_expression() take an op argument
[smatch.git] / validation / linear / bitfield-init-zero.c
blob39a64345ed75d24559cac424192bedd6ec28f749
1 struct bfu {
2 unsigned int a:11;
3 unsigned int f:9;
4 unsigned int :2;
5 unsigned int z:3;
6 };
8 struct bfu bfuu_init(unsigned int a)
10 struct bfu bf = { .f = a, };
11 return bf;
14 struct bfu bfus_init(int a)
16 struct bfu bf = { .f = a, };
17 return bf;
20 unsigned int bfu_get0(void)
22 struct bfu bf = { };
23 return bf.f;
27 struct bfs {
28 signed int a:11;
29 signed int f:9;
30 signed int :2;
31 signed int z:3;
34 struct bfs bfsu_init(unsigned int a)
36 struct bfs bf = { .f = a, };
37 return bf;
40 struct bfs bfss_init(int a)
42 struct bfs bf = { .f = a, };
43 return bf;
46 int bfs_get0(void)
48 struct bfs bf = { };
49 return bf.f;
53 * check-name: bitfield implicit init zero
54 * check-command: test-linearize -Wno-decl $file
56 * check-output-start
57 bfuu_init:
58 .L0:
59 <entry-point>
60 cast.9 %r2 <- (32) %arg1
61 shl.32 %r4 <- %r2, $11
62 ret.32 %r4
65 bfus_init:
66 .L2:
67 <entry-point>
68 scast.9 %r10 <- (32) %arg1
69 shl.32 %r12 <- %r10, $11
70 ret.32 %r12
73 bfu_get0:
74 .L4:
75 <entry-point>
76 ret.32 $0
79 bfsu_init:
80 .L6:
81 <entry-point>
82 cast.9 %r23 <- (32) %arg1
83 shl.32 %r25 <- %r23, $11
84 ret.32 %r25
87 bfss_init:
88 .L8:
89 <entry-point>
90 scast.9 %r31 <- (32) %arg1
91 shl.32 %r33 <- %r31, $11
92 ret.32 %r33
95 bfs_get0:
96 .L10:
97 <entry-point>
98 ret.32 $0
101 * check-output-end