From 9b112cec8363c0c574750d92cffe8682e80aacbe Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Tue, 15 Mar 2022 08:56:07 -0700 Subject: [PATCH] internal/cpu: don't run SSE3 disable test if GOAMD64>1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit That feature can't be disabled if the microarchitectural version requires it. Change-Id: Iad8aaa8089d2f023e9ae5044c6da33224499f09b Reviewed-on: https://go-review.googlesource.com/c/go/+/392994 Run-TryBot: Keith Randall Trust: Keith Randall Reviewed-by: Tobias Klauser Reviewed-by: Martin Möhrmann TryBot-Result: Gopher Robot --- src/internal/cpu/cpu_x86_test.go | 3 +++ src/internal/cpu/export_x86_test.go | 11 +++++++++++ 2 files changed, 14 insertions(+) create mode 100644 src/internal/cpu/export_x86_test.go diff --git a/src/internal/cpu/cpu_x86_test.go b/src/internal/cpu/cpu_x86_test.go index c8be210055c..43d6b211ea4 100644 --- a/src/internal/cpu/cpu_x86_test.go +++ b/src/internal/cpu/cpu_x86_test.go @@ -19,6 +19,9 @@ func TestX86ifAVX2hasAVX(t *testing.T) { } func TestDisableSSE3(t *testing.T) { + if GetGOAMD64level() > 1 { + t.Skip("skipping test: can't run on GOAMD64>v1 machines") + } runDebugOptionsTest(t, "TestSSE3DebugOption", "cpu.sse3=off") } diff --git a/src/internal/cpu/export_x86_test.go b/src/internal/cpu/export_x86_test.go new file mode 100644 index 00000000000..a12b6f27234 --- /dev/null +++ b/src/internal/cpu/export_x86_test.go @@ -0,0 +1,11 @@ +// Copyright 2022 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build 386 || amd64 + +package cpu + +var ( + GetGOAMD64level = getGOAMD64level +)