mirror of
https://github.com/golang/go
synced 2024-11-11 20:01:37 -07:00
501b786e5c
Prep for subsequent CLs to remove old escape analysis pass. This CL removes -newescape=true from tests that use it, and deletes tests that use -newescape=false. (For history, see CL 170447.) Notably, this removes escape_because.go without any replacement, but this is being tracked by #31489. Change-Id: I6f6058d58fff2c5d210cb1d2713200cc9f501ca7 Reviewed-on: https://go-review.googlesource.com/c/go/+/187617 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
24 lines
472 B
Go
24 lines
472 B
Go
// 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]
|
|
}
|