Source file
test/codegen/issue72832.go
1
2
3
4
5
6
7 package codegen
8
9 type tile1 struct {
10 a uint16
11 b uint16
12 c uint32
13 }
14
15 func store_tile1(t *tile1) {
16
17 t.a, t.b, t.c = 1, 1, 1
18 }
19
20 type tile2 struct {
21 a, b, c, d, e int8
22 }
23
24 func store_tile2(t *tile2) {
25
26 t.a, t.b = 1, 1
27
28 t.d, t.e = 1, 1
29 }
30
31 type tile3 struct {
32 a, b uint8
33 c uint16
34 }
35
36 func store_shifted(t *tile3, x uint32) {
37
38
39 t.a = uint8(x)
40 t.b = uint8(x >> 8)
41 t.c = uint16(x >> 16)
42 }
43
44 func store_const(t *tile3) {
45
46
47
48
49 t.a, t.b, t.c = 1, 2, 3
50 }
51
View as plain text