1
0
mirror of https://github.com/golang/go synced 2024-11-17 02:14:42 -07:00

internal/cpu: skip arm64 feature test on unsupported GOOS

Fixes #24753

Change-Id: Ic6049da98b8eee41223df71ffafa71a894915bd7
Reviewed-on: https://go-review.googlesource.com/105455
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Meng Zhuo 2018-04-08 10:30:15 +08:00 committed by Brad Fitzpatrick
parent bbfae469a1
commit c00c1efbd8

View File

@ -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")
}
}