1
0
mirror of https://github.com/golang/go synced 2024-09-23 15:20:13 -06:00

test: fix inline test on noopt builder

CL 394074 broke the noopt builder. Something about time.After's inlining
depends on the build flags to make.bash, not the build flags that run.go
passes.

Change-Id: Ib284c66ea2008a4d32829c055d57c54a34ec3fb4
Reviewed-on: https://go-review.googlesource.com/c/go/+/396037
Trust: Keith Randall <khr@golang.org>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
This commit is contained in:
Keith Randall 2022-03-26 12:21:36 -07:00
parent 3bd8c78575
commit 018b78cc5b

View File

@ -11,7 +11,6 @@ package foo
import (
"runtime"
"time"
"unsafe"
)
@ -314,21 +313,21 @@ func select1(x, y chan bool) int { // ERROR "can inline select1" "x does not esc
}
}
func select2(x chan bool) { // ERROR "can inline select2" "x does not escape"
func select2(x, y chan bool) { // ERROR "can inline select2" "x does not escape" "y does not escape"
loop: // test that labeled select can be inlined.
select {
case <-x:
break loop
case <-time.After(time.Second): // ERROR "inlining call to time.After"
case <-y:
}
}
func inlineSelect2(x, y chan bool) { // ERROR "x does not escape" "y does not escape"
func inlineSelect2(x, y chan bool) { // ERROR "can inline inlineSelect2" ERROR "x does not escape" "y does not escape"
loop:
for i := 0; i < 5; i++ {
if i == 3 {
break loop
}
select2(x) // ERROR "inlining call to select2" "inlining call to time.After"
select2(x, y) // ERROR "inlining call to select2"
}
}