Source file
test/fixedbugs/issue21048.go
1
2
3
4
5
6
7
8
9
10
11 package main
12
13 type T struct {
14 _ [1]byte
15 a [2]byte
16 _ [3]byte
17 b [2]uint16
18 _ [2]byte
19 c [2]uint32
20 _ [2]byte
21 d [2]int16
22 _ [2]byte
23 e [2]int32
24 }
25
26 var Source, Sink T
27
28 func newT() T {
29 return T{
30 a: [2]byte{1, 2},
31 b: [2]uint16{1, 2},
32 c: [2]uint32{1, 2},
33 d: [2]int16{1, 2},
34 e: [2]int32{1, 2},
35 }
36 }
37
38
39 func moves() {
40 Sink.a = Source.a
41 Sink.b = Source.b
42 Sink.c = Source.c
43 Sink.d = Source.d
44 Sink.e = Source.e
45 }
46
47
48 func loads() *T {
49 t := newT()
50 t.a = Source.a
51 t.b = Source.b
52 t.c = Source.c
53 t.d = Source.d
54 t.e = Source.e
55 return &t
56 }
57
58
59 func stores() {
60 t := newT()
61 Sink.a = t.a
62 Sink.b = t.b
63 Sink.c = t.c
64 Sink.d = t.d
65 Sink.e = t.e
66 }
67
68 func main() {
69 moves()
70 loads()
71 stores()
72 }
73
View as plain text