aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCuong Manh Le <cuong.manhle.vn@gmail.com>2023-05-23 10:39:43 +0700
committerGopher Robot <gobot@golang.org>2023-05-23 17:16:35 +0000
commit4e679e26a3282e71d8dcb8af53bc21a9c1b1efe4 (patch)
treeb67f67068d48a8729ceca642638434cd72029bc6
parent1a22008f2f3d4d5ea3e6b26b8ae9c6ce5d7f848f (diff)
downloadgo-4e679e26a3282e71d8dcb8af53bc21a9c1b1efe4.tar.xz
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>
-rw-r--r--test/escape_iface.go10
-rw-r--r--test/escape_iface_unified.go22
-rw-r--r--test/inline.go12
-rw-r--r--test/inline_unified.go19
4 files changed, 22 insertions, 41 deletions
diff --git a/test/escape_iface.go b/test/escape_iface.go
index 986228129a..d822cca2f8 100644
--- a/test/escape_iface.go
+++ b/test/escape_iface.go
@@ -234,6 +234,16 @@ func dotTypeEscape2() { // #13805, #15796
*(&v) = x.(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"
j := 0 // ERROR "moved to heap: j"
diff --git a/test/escape_iface_unified.go b/test/escape_iface_unified.go
deleted file mode 100644
index 80dc80ca7b..0000000000
--- a/test/escape_iface_unified.go
+++ /dev/null
@@ -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"
- }
-}
diff --git a/test/inline.go b/test/inline.go
index af39ad8cb5..3a9cd5c20c 100644
--- a/test/inline.go
+++ b/test/inline.go
@@ -110,6 +110,18 @@ func q(x int) int { // ERROR "can inline q"
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"
foo := func() { // ERROR "can inline s0.func1" "func literal does not escape"
x = x + 1
diff --git a/test/inline_unified.go b/test/inline_unified.go
deleted file mode 100644
index c1b248e091..0000000000
--- a/test/inline_unified.go
+++ /dev/null
@@ -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"
-}