Source file
test/fixedbugs/issue14591.go
1
2
3
4
5
6
7
8
9
10
11 package main
12
13 import (
14 "fmt"
15 "runtime"
16 )
17
18
19
20 type T [4]int
21
22 func f() (r, s *T) {
23 r = &T{0x30, 0x31, 0x32, 0x33}
24 runtime.GC()
25 s = &T{0x40, 0x41, 0x42, 0x43}
26 runtime.GC()
27 return
28 }
29
30 func main() {
31 r, s := f()
32 if r[1] != 0x31 {
33 fmt.Printf("bad r[1], want 0x31 got %x\n", r[1])
34 }
35 if s[1] != 0x41 {
36 fmt.Printf("bad s[1], want 0x41 got %x\n", s[1])
37 }
38 }
39
View as plain text