diff options
| author | Cuong Manh Le <cuong.manhle.vn@gmail.com> | 2023-05-23 10:39:43 +0700 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2023-05-23 17:16:35 +0000 |
| commit | 4e679e26a3282e71d8dcb8af53bc21a9c1b1efe4 (patch) | |
| tree | b67f67068d48a8729ceca642638434cd72029bc6 /test/inline.go | |
| parent | 1a22008f2f3d4d5ea3e6b26b8ae9c6ce5d7f848f (diff) | |
| download | go-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>
Diffstat (limited to 'test/inline.go')
| -rw-r--r-- | test/inline.go | 12 |
1 files changed, 12 insertions, 0 deletions
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 |
