1
0
mirror of https://github.com/golang/go synced 2024-11-26 21:11:57 -07:00
go/test/fixedbugs/issue20250.go
Matthew Dempsky 72a857a280 test: relax fixedbugs/issue20250.go expectations
With GOEXPERIMENT=unified, the order variables are printed in "live at
entry to f.func1" is sensitive to whether regabi is enabled for some
reason. The order shouldn't matter to correctness, but it is odd.

For now, this CL just relaxes the test expectation order to unblock
enabling GOEXPERIMENT=unified by default. I've filed #54402 to
investigate further to confirm this a concern.

Updates #54402.

Change-Id: Iddfbb12c6cf7cc17b2aec8102b33761abd5f93ad
Reviewed-on: https://go-review.googlesource.com/c/go/+/422975
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
2022-08-11 20:03:02 +00:00

27 lines
787 B
Go

// errorcheck -0 -live -l
// Copyright 2017 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.
// Issue 20250: liveness differed with concurrent compilation
// due to propagation of addrtaken to outer variables for
// closure variables.
package p
type T struct {
s [2]string
}
func f(a T) { // ERROR "live at entry to f: a"
var e interface{} // ERROR "stack object e interface \{\}$"
// TODO(go.dev/issue/54402): Investigate why "live at entry to
// f.func1" is sensitive to regabi.
func() { // ERROR "live at entry to f.func1: (a &e|&e a)"
e = a.s // ERROR "live at call to convT: &e" "stack object a T$"
}()
// Before the fix, both a and e were live at the previous line.
_ = e
}