Source file
test/fixedbugs/issue30977.go
1
2
3
4
5
6
7
8
9
10 package main
11
12 import "runtime"
13
14 type T struct {
15 a, b, c, d, e string
16 }
17
18
19 func g() T {
20 return T{"a", "b", "c", "d", "e"}
21 }
22
23
24 func f() {
25
26
27
28
29 X = g()
30 Y = X
31 }
32
33 var X, Y T
34
35 const N = 1000
36
37 func main() {
38
39 go func() {
40 for {
41 runtime.GC()
42 }
43 }()
44
45 for i := 0; i < N; i++ {
46 runtime.Gosched()
47 f()
48 if X != Y {
49 panic("FAIL")
50 }
51 }
52 }
53
View as plain text