mirror of
https://github.com/golang/go
synced 2024-11-23 04:30:03 -07:00
27a30186ab
The order array was zero initialized by the compiler, but ends up being overwritten by the runtime anyway. So let the runtime takes full responsibility for initializing, save us one instruction per select. Fixes #40399 Change-Id: Iec1eca27ad7180d4fcb3cc9ef97348206b7fe6b8 Reviewed-on: https://go-review.googlesource.com/c/go/+/251517 Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
21 lines
353 B
Go
21 lines
353 B
Go
// asmcheck
|
|
|
|
// Copyright 2020 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package codegen
|
|
|
|
func f() {
|
|
ch1 := make(chan int)
|
|
ch2 := make(chan int)
|
|
for {
|
|
// amd64:-`MOVQ\t[$]0, ""..autotmp_3`
|
|
select {
|
|
case <-ch1:
|
|
case <-ch2:
|
|
default:
|
|
}
|
|
}
|
|
}
|