From: Meng Zhuo Date: Sun, 8 Apr 2018 02:30:15 +0000 (+0800) Subject: internal/cpu: skip arm64 feature test on unsupported GOOS X-Git-Tag: go1.11beta1~926 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=c00c1efbd8f763eb087912c54c036c21f310b98f;p=gostls13.git 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 Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- diff --git a/src/internal/cpu/cpu_test.go b/src/internal/cpu/cpu_test.go index 37ea39f31e..35d041bccb 100644 --- a/src/internal/cpu/cpu_test.go +++ b/src/internal/cpu/cpu_test.go @@ -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") } }