Skip to content

Commit 4e679e2

Browse files
cuonglmgopherbot
authored andcommitted
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 <[email protected]> Reviewed-by: Matthew Dempsky <[email protected]> Reviewed-by: Keith Randall <[email protected]> Reviewed-by: Keith Randall <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Auto-Submit: Cuong Manh Le <[email protected]>
1 parent 1a22008 commit 4e679e2

File tree

4 files changed

+22
-41
lines changed

4 files changed

+22
-41
lines changed

test/escape_iface.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,16 @@ func dotTypeEscape2() { // #13805, #15796
234234
*(&v) = x.(int)
235235
*(&v), *(&ok) = y.(int)
236236
}
237+
{ // #13805, #15796
238+
i := 0
239+
j := 0
240+
var ok bool
241+
var x interface{} = i // ERROR "i does not escape"
242+
var y interface{} = j // ERROR "j does not escape"
243+
244+
sink = x.(int) // ERROR "x.\(int\) escapes to heap"
245+
sink, *(&ok) = y.(int) // ERROR "autotmp_.* escapes to heap"
246+
}
237247
{
238248
i := 0 // ERROR "moved to heap: i"
239249
j := 0 // ERROR "moved to heap: j"

test/escape_iface_unified.go

Lines changed: 0 additions & 22 deletions
This file was deleted.

test/inline.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,18 @@ func q(x int) int { // ERROR "can inline q"
110110
return foo() // ERROR "inlining call to q.func1"
111111
}
112112

113+
func r(z int) int {
114+
foo := func(x int) int { // ERROR "can inline r.func1" "func literal does not escape"
115+
return x + z
116+
}
117+
bar := func(x int) int { // ERROR "func literal does not escape" "can inline r.func2"
118+
return x + func(y int) int { // ERROR "can inline r.func2.1" "can inline r.r.func2.func3"
119+
return 2*y + x*z
120+
}(x) // ERROR "inlining call to r.func2.1"
121+
}
122+
return foo(42) + bar(42) // ERROR "inlining call to r.func1" "inlining call to r.func2" "inlining call to r.r.func2.func3"
123+
}
124+
113125
func s0(x int) int { // ERROR "can inline s0"
114126
foo := func() { // ERROR "can inline s0.func1" "func literal does not escape"
115127
x = x + 1

test/inline_unified.go

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)