diff options
author | Matthew Dempsky <mdempsky@google.com> | 2017-03-07 14:26:27 -0800 |
---|---|---|
committer | Matthew Dempsky <mdempsky@google.com> | 2018-05-01 03:17:44 +0000 |
commit | 004260afdee7c2040f3b52e7517be4f172aa0d58 (patch) | |
tree | 26fb4a21eca8519ac66e009223dc03901e0b21b1 /test/live.go | |
parent | 3aa53b31350dff905deefb97e6670a14f166d2a9 (diff) | |
download | go-004260afdee7c2040f3b52e7517be4f172aa0d58.tar.gz go-004260afdee7c2040f3b52e7517be4f172aa0d58.zip |
cmd/compile: open code select{send,recv,default}
Registration now looks like:
var cases [4]runtime.scases
var order [8]uint16
cases[0].kind = caseSend
cases[0].c = c1
cases[0].elem = &v1
if raceenabled || msanenabled {
selectsetpc(&cases[0])
}
cases[1].kind = caseRecv
cases[1].c = c2
cases[1].elem = &v2
if raceenabled || msanenabled {
selectsetpc(&cases[1])
}
...
Change-Id: Ib9bcf426a4797fe4bfd8152ca9e6e08e39a70b48
Reviewed-on: https://go-review.googlesource.com/37934
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Diffstat (limited to 'test/live.go')
-rw-r--r-- | test/live.go | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/test/live.go b/test/live.go index 43ef9bdad2..8de3cf7e86 100644 --- a/test/live.go +++ b/test/live.go @@ -164,9 +164,9 @@ var b bool // this used to have a spurious "live at entry to f11a: ~r0" func f11a() *int { select { // ERROR "live at call to selectgo: .autotmp_[0-9]+$" - case <-c: // ERROR "live at call to selectrecv: .autotmp_[0-9]+$" + case <-c: return nil - case <-c: // ERROR "live at call to selectrecv: .autotmp_[0-9]+$" + case <-c: return nil } } @@ -179,9 +179,9 @@ func f11b() *int { // This used to have a spurious "live at call to printint: p". printint(1) // nothing live here! select { // ERROR "live at call to selectgo: .autotmp_[0-9]+$" - case <-c: // ERROR "live at call to selectrecv: .autotmp_[0-9]+$" + case <-c: return nil - case <-c: // ERROR "live at call to selectrecv: .autotmp_[0-9]+$" + case <-c: return nil } } @@ -199,8 +199,8 @@ func f11c() *int { // so we can get to the println, so p is not dead. printint(1) // ERROR "live at call to printint: p$" select { // ERROR "live at call to selectgo: .autotmp_[0-9]+ p$" - case <-c: // ERROR "live at call to selectrecv: .autotmp_[0-9]+ p$" - case <-c: // ERROR "live at call to selectrecv: .autotmp_[0-9]+ p$" + case <-c: + case <-c: } } println(*p) @@ -590,13 +590,13 @@ func f38(b bool) { // and therefore no output. if b { select { // ERROR "live at call to selectgo:( .autotmp_[0-9]+)+$" - case <-fc38(): // ERROR "live at call to selectrecv:( .autotmp_[0-9]+)+$" + case <-fc38(): printnl() - case fc38() <- *fi38(1): // ERROR "live at call to fc38:( .autotmp_[0-9]+)+$" "live at call to fi38:( .autotmp_[0-9]+)+$" "live at call to selectsend:( .autotmp_[0-9]+)+$" + case fc38() <- *fi38(1): // ERROR "live at call to fc38:( .autotmp_[0-9]+)+$" "live at call to fi38:( .autotmp_[0-9]+)+$" printnl() - case *fi38(2) = <-fc38(): // ERROR "live at call to fc38:( .autotmp_[0-9]+)+$" "live at call to fi38:( .autotmp_[0-9]+)+$" "live at call to selectrecv:( .autotmp_[0-9]+)+$" + case *fi38(2) = <-fc38(): // ERROR "live at call to fc38:( .autotmp_[0-9]+)+$" "live at call to fi38:( .autotmp_[0-9]+)+$" printnl() - case *fi38(3), *fb38() = <-fc38(): // ERROR "live at call to fb38:( .autotmp_[0-9]+)+$" "live at call to fc38:( .autotmp_[0-9]+)+$" "live at call to fi38:( .autotmp_[0-9]+)+$" "live at call to selectrecv:( .autotmp_[0-9]+)+$" + case *fi38(3), *fb38() = <-fc38(): // ERROR "live at call to fb38:( .autotmp_[0-9]+)+$" "live at call to fc38:( .autotmp_[0-9]+)+$" "live at call to fi38:( .autotmp_[0-9]+)+$" printnl() } printnl() |