From c00c1efbd8f763eb087912c54c036c21f310b98f Mon Sep 17 00:00:00 2001 From: Meng Zhuo Date: Sun, 8 Apr 2018 10:30:15 +0800 Subject: [PATCH] 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 --- src/internal/cpu/cpu_test.go | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) 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") } } -- 2.50.0