]> Cypherpunks.ru repositories - gostls13.git/commitdiff
test: remove *_unified.go variants
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Tue, 23 May 2023 03:39:43 +0000 (10:39 +0700)
committerGopher Robot <gobot@golang.org>
Tue, 23 May 2023 17:16:35 +0000 (17:16 +0000)
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>

test/escape_iface.go
test/escape_iface_unified.go [deleted file]
test/inline.go
test/inline_unified.go [deleted file]

index 986228129a698c18ae638552d8c84b1c631c5c2b..d822cca2f8485fa6b263cbb2db1599c9fcd4e0e1 100644 (file)
@@ -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 (file)
index 80dc80c..0000000
+++ /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"
-       }
-}
index af39ad8cb5a6aef283a190263ac4f9db12068ba8..3a9cd5c20c6716c06d4b5bad4c3a52d60e1ab10d 100644 (file)
@@ -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 (file)
index c1b248e..0000000
+++ /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"
-}