]> Cypherpunks repositories - gostls13.git/commitdiff
test: fix inline test on noopt builder
authorKeith Randall <khr@golang.org>
Sat, 26 Mar 2022 19:21:36 +0000 (12:21 -0700)
committerKeith Randall <khr@golang.org>
Sun, 27 Mar 2022 18:38:56 +0000 (18:38 +0000)
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>
test/inline.go

index 95af923a26a9b4794ca8620f5d18a696ed36a6c9..cb8403e9ce1216e79dfa11e28c32c996ccd67712 100644 (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"
        }
 }