Commit c00c1efb authored by Meng Zhuo's avatar Meng Zhuo Committed by Brad Fitzpatrick

internal/cpu: skip arm64 feature test on unsupported GOOS

Fixes #24753

Change-Id: Ic6049da98b8eee41223df71ffafa71a894915bd7
Reviewed-on: https://go-review.googlesource.com/105455Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent bbfae469
......@@ -50,12 +50,21 @@ func TestPPC64minimalFeatures(t *testing.T) {
}
func TestARM64minimalFeatures(t *testing.T) {
if runtime.GOARCH == "arm64" {
if !cpu.ARM64.HasASIMD {
t.Fatalf("HasASIMD expected true, got false")
}
if !cpu.ARM64.HasFP {
t.Fatalf("HasFP expected true, got false")
}
if runtime.GOARCH != "arm64" {
return
}
switch runtime.GOOS {
case "linux", "android":
default:
t.Skipf("%s/arm64 is not supported", runtime.GOOS)
}
if !cpu.ARM64.HasASIMD {
t.Fatalf("HasASIMD expected true, got false")
}
if !cpu.ARM64.HasFP {
t.Fatalf("HasFP expected true, got false")
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment