blob: 560b7d4794251b8a2f16b1a47fd577a05769142a [file] [log] [blame]
Austin Clementsa8ae93f2015-06-23 11:35:21 -04001// run
2
3// Copyright 2015 The Go Authors. All rights reserved.
4// Use of this source code is governed by a BSD-style
5// license that can be found in the LICENSE file.
6
7// Test that pointer bitmaps of types with large scalar tails are
8// correctly repeated when unrolled into the heap bitmap.
9
10package main
11
12import "runtime"
13
14const D = 57
15
16type T struct {
17 a [D]float64
18 b map[string]int
19 c [D]float64
20}
21
22var ts []T
23
24func main() {
25 ts = make([]T, 4)
26 for i := range ts {
27 ts[i].b = make(map[string]int)
28 }
29 ts[3].b["abc"] = 42
30 runtime.GC()
31 if ts[3].b["abc"] != 42 {
32 panic("bad field value")
33 }
34}