mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
crypto/internal/cryptotest: use linux-amd64_avx512 builder for SHA-NI
Updates #74772 Fixes #69592 Change-Id: I6a6a69647ab1785ed953f3ed2dfa04cd55576f2b Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64_avx512 Reviewed-on: https://go-review.googlesource.com/c/go/+/701315 Reviewed-by: Daniel McCarney <daniel@binaryparadox.net> Reviewed-by: Mark Freeman <markfreeman@google.com> Auto-Submit: Filippo Valsorda <filippo@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
This commit is contained in:
parent
8105d0ccc2
commit
b9e2977f1d
1 changed files with 19 additions and 7 deletions
|
|
@ -10,6 +10,7 @@ import (
|
|||
"internal/goarch"
|
||||
"internal/goos"
|
||||
"internal/testenv"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
|
|
@ -38,22 +39,33 @@ func TestAllImplementations(t *testing.T, pkg string, f func(t *testing.T)) {
|
|||
t.Run(name, func(t *testing.T) {
|
||||
// Report an error if we're on the most capable builder for the
|
||||
// architecture and the builder can't test this implementation.
|
||||
flagship := goos.GOOS == "linux" && goarch.GOARCH != "arm64" ||
|
||||
goos.GOOS == "darwin" && goarch.GOARCH == "arm64"
|
||||
if testenv.Builder() != "" && flagship {
|
||||
if name == "SHA-NI" {
|
||||
t.Skip("known issue, see golang.org/issue/69592")
|
||||
}
|
||||
if flagshipBuilder() {
|
||||
t.Error("builder doesn't support CPU features needed to test this implementation")
|
||||
} else {
|
||||
t.Skip("implementation not supported")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Test the generic implementation.
|
||||
impl.Select(pkg, "")
|
||||
t.Run("Base", f)
|
||||
}
|
||||
|
||||
func flagshipBuilder() bool {
|
||||
builder := testenv.Builder()
|
||||
if builder == "" {
|
||||
return false
|
||||
}
|
||||
switch goarch.GOARCH {
|
||||
case "amd64":
|
||||
return strings.Contains(builder, "_avx512")
|
||||
case "arm64":
|
||||
// Apple M chips support everything we use.
|
||||
return goos.GOOS == "darwin"
|
||||
default:
|
||||
// Presumably the Linux builders are the most capable.
|
||||
return goos.GOOS == "linux"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue