aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorCuong Manh Le <cuong.manhle.vn@gmail.com>2023-08-27 00:01:37 +0700
committerGopher Robot <gobot@golang.org>2024-07-22 21:27:37 +0000
commit2e8b3425a2797353145b296d23ea2f23cdb07812 (patch)
tree25e82ef4c3bff3c87d54fc1f1a9262bbb41ce97a /test
parentd25a90676d5212f156de334e9f6f9ee009298c9c (diff)
downloadgo-2e8b3425a2797353145b296d23ea2f23cdb07812.tar.xz
cmd/compile: retire "IsHiddenClosure" and "IsDeadcodeClosure"
Since CL 522318, all closures are now hidden. Thus this CL removes all codes that worries about hidden vs non-hidden closures. Change-Id: I1ea124168c76cedbfc4053d2f150937a382aa330 Reviewed-on: https://go-review.googlesource.com/c/go/+/523275 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Than McIntosh <thanm@google.com>
Diffstat (limited to 'test')
-rw-r--r--test/closure3.dir/main.go4
-rw-r--r--test/escape4.go2
-rw-r--r--test/escape_closure.go2
3 files changed, 4 insertions, 4 deletions
diff --git a/test/closure3.dir/main.go b/test/closure3.dir/main.go
index 441da70105..e3981a5161 100644
--- a/test/closure3.dir/main.go
+++ b/test/closure3.dir/main.go
@@ -94,7 +94,7 @@ func main() {
return x + 2
}
y, sink = func() (func(int) int, int) { // ERROR "can inline main.func12"
- return func(x int) int { // ERROR "can inline main.func12"
+ return func(x int) int { // ERROR "can inline main.func12" "func literal escapes to heap"
return x + 1
}, 42
}() // ERROR "func literal does not escape" "inlining call to main.func12"
@@ -109,7 +109,7 @@ func main() {
return x + 2
}
y, sink = func() (func(int) int, int) { // ERROR "can inline main.func13.2"
- return func(x int) int { // ERROR "can inline main.func13.2"
+ return func(x int) int { // ERROR "can inline main.func13.2" "func literal escapes to heap"
return x + 1
}, 42
}() // ERROR "func literal does not escape" "inlining call to main.func13.2"
diff --git a/test/escape4.go b/test/escape4.go
index c4a2fc15e7..ddeaff81ec 100644
--- a/test/escape4.go
+++ b/test/escape4.go
@@ -25,7 +25,7 @@ func f1() {
// Escape analysis used to miss inlined code in closures.
func() { // ERROR "can inline f1.func1"
- p = alloc(3) // ERROR "inlining call to alloc"
+ p = alloc(3) // ERROR "inlining call to alloc" "moved to heap: x"
}() // ERROR "inlining call to f1.func1" "inlining call to alloc" "moved to heap: x"
f = func() { // ERROR "func literal escapes to heap" "can inline f1.func2"
diff --git a/test/escape_closure.go b/test/escape_closure.go
index 0b19d6f6e8..84f3adf35d 100644
--- a/test/escape_closure.go
+++ b/test/escape_closure.go
@@ -134,7 +134,7 @@ func ClosureCallArgs14() {
func ClosureCallArgs15() {
x := 0 // ERROR "moved to heap: x"
p := &x
- sink = func(p **int) *int { // ERROR "leaking param content: p" "func literal does not escape"
+ sink = func(p **int) *int { // ERROR "leaking param: p to result ~r0 level=1" "func literal does not escape"
return *p
}(&p)
}