From 018b78cc5b4b08447076f143271c249c0dde1297 Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Sat, 26 Mar 2022 12:21:36 -0700 Subject: [PATCH] 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 Run-TryBot: Keith Randall TryBot-Result: Gopher Robot Reviewed-by: Emmanuel Odeke --- test/inline.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/test/inline.go b/test/inline.go index 95af923a26..cb8403e9ce 100644 --- a/test/inline.go +++ b/test/inline.go @@ -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" } } -- 2.50.0