mirror of
https://github.com/golang/go.git
synced 2025-05-05 15:43:04 +00:00
test: remove *_unified.go variants
CL 415241 and CL 411935 break tests into unified/nounified variants, for compatibility with old frontend while developing unified IR. Now the old frontend was gone, so moving those tests back to the original files. Change-Id: Iecdcd4e6ee33c723f6ac02189b0be26248e15f0f Reviewed-on: https://go-review.googlesource.com/c/go/+/497275 Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
This commit is contained in:
parent
1a22008f2f
commit
4e679e26a3
@ -234,6 +234,16 @@ func dotTypeEscape2() { // #13805, #15796
|
|||||||
*(&v) = x.(int)
|
*(&v) = x.(int)
|
||||||
*(&v), *(&ok) = y.(int)
|
*(&v), *(&ok) = y.(int)
|
||||||
}
|
}
|
||||||
|
{ // #13805, #15796
|
||||||
|
i := 0
|
||||||
|
j := 0
|
||||||
|
var ok bool
|
||||||
|
var x interface{} = i // ERROR "i does not escape"
|
||||||
|
var y interface{} = j // ERROR "j does not escape"
|
||||||
|
|
||||||
|
sink = x.(int) // ERROR "x.\(int\) escapes to heap"
|
||||||
|
sink, *(&ok) = y.(int) // ERROR "autotmp_.* escapes to heap"
|
||||||
|
}
|
||||||
{
|
{
|
||||||
i := 0 // ERROR "moved to heap: i"
|
i := 0 // ERROR "moved to heap: i"
|
||||||
j := 0 // ERROR "moved to heap: j"
|
j := 0 // ERROR "moved to heap: j"
|
||||||
|
@ -1,22 +0,0 @@
|
|||||||
// errorcheck -0 -m -l
|
|
||||||
|
|
||||||
// Copyright 2015 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 escape
|
|
||||||
|
|
||||||
var sink interface{}
|
|
||||||
|
|
||||||
func dotTypeEscape2() { // #13805, #15796
|
|
||||||
{
|
|
||||||
i := 0
|
|
||||||
j := 0
|
|
||||||
var ok bool
|
|
||||||
var x interface{} = i // ERROR "i does not escape"
|
|
||||||
var y interface{} = j // ERROR "j does not escape"
|
|
||||||
|
|
||||||
sink = x.(int) // ERROR "x.\(int\) escapes to heap"
|
|
||||||
sink, *(&ok) = y.(int) // ERROR "autotmp_.* escapes to heap"
|
|
||||||
}
|
|
||||||
}
|
|
@ -110,6 +110,18 @@ func q(x int) int { // ERROR "can inline q"
|
|||||||
return foo() // ERROR "inlining call to q.func1"
|
return foo() // ERROR "inlining call to q.func1"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func r(z int) int {
|
||||||
|
foo := func(x int) int { // ERROR "can inline r.func1" "func literal does not escape"
|
||||||
|
return x + z
|
||||||
|
}
|
||||||
|
bar := func(x int) int { // ERROR "func literal does not escape" "can inline r.func2"
|
||||||
|
return x + func(y int) int { // ERROR "can inline r.func2.1" "can inline r.r.func2.func3"
|
||||||
|
return 2*y + x*z
|
||||||
|
}(x) // ERROR "inlining call to r.func2.1"
|
||||||
|
}
|
||||||
|
return foo(42) + bar(42) // ERROR "inlining call to r.func1" "inlining call to r.func2" "inlining call to r.r.func2.func3"
|
||||||
|
}
|
||||||
|
|
||||||
func s0(x int) int { // ERROR "can inline s0"
|
func s0(x int) int { // ERROR "can inline s0"
|
||||||
foo := func() { // ERROR "can inline s0.func1" "func literal does not escape"
|
foo := func() { // ERROR "can inline s0.func1" "func literal does not escape"
|
||||||
x = x + 1
|
x = x + 1
|
||||||
|
@ -1,19 +0,0 @@
|
|||||||
// errorcheckwithauto -0 -m -d=inlfuncswithclosures=1
|
|
||||||
|
|
||||||
// Copyright 2022 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 foo
|
|
||||||
|
|
||||||
func r(z int) int {
|
|
||||||
foo := func(x int) int { // ERROR "can inline r.func1" "func literal does not escape"
|
|
||||||
return x + z
|
|
||||||
}
|
|
||||||
bar := func(x int) int { // ERROR "func literal does not escape" "can inline r.func2"
|
|
||||||
return x + func(y int) int { // ERROR "can inline r.func2.1" "can inline r.r.func2.func3"
|
|
||||||
return 2*y + x*z
|
|
||||||
}(x) // ERROR "inlining call to r.func2.1"
|
|
||||||
}
|
|
||||||
return foo(42) + bar(42) // ERROR "inlining call to r.func1" "inlining call to r.func2" "inlining call to r.r.func2.func3"
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user