1
0
mirror of https://github.com/golang/go synced 2024-11-18 02:14:45 -07:00
go/test/fixedbugs/issue39292.go
Matthew Dempsky 69d34e2c69 test: bump array size in fixedbugs/issue39292.go
The previous array length was large enough to exceed
maxImplicitStackSize on 64-bit architectures, but not on 32-bit
architectures.

Fixes #40808.

Change-Id: I69e9abb447454b2e7875ba503a0cb772e965ae31
Reviewed-on: https://go-review.googlesource.com/c/go/+/248680
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2020-08-15 04:45:34 +00:00

30 lines
570 B
Go

// errorcheck -0 -m -l
// Copyright 2020 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.
package p
type t [20000]*int
func (t) f() {
}
func x() {
x := t{}.f // ERROR "t literal.f escapes to heap"
x()
}
func y() {
var i int // ERROR "moved to heap: i"
y := (&t{&i}).f // ERROR "\(&t literal\).f escapes to heap" "&t literal escapes to heap"
y()
}
func z() {
var i int // ERROR "moved to heap: i"
z := t{&i}.f // ERROR "t literal.f escapes to heap"
z()
}