summaryrefslogtreecommitdiffstats
path: root/test/fixedbugs/issue27732a.go
blob: 2d0198da0e89773fb816d0d50d60cbeae3e6b79f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// errorcheck -0 -m -l -smallframes

// Copyright 2019 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// This checks that the -smallframes flag forces a large variable to heap.

package main

const (
	bufferLen = 200000
)

type kbyte []byte
type circularBuffer [bufferLen]kbyte

var sink byte

func main() {
	var c circularBuffer // ERROR "moved to heap: c$"
	sink = c[0][0]
}