1 // Copyright 2018 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
5 //go:build 386 || amd64
15 func TestX86ifAVX2hasAVX(t *testing.T) {
16 if X86.HasAVX2 && !X86.HasAVX {
17 t.Fatalf("HasAVX expected true when HasAVX2 is true, got false")
21 func TestDisableSSE3(t *testing.T) {
22 if GetGOAMD64level() > 1 {
23 t.Skip("skipping test: can't run on GOAMD64>v1 machines")
25 runDebugOptionsTest(t, "TestSSE3DebugOption", "cpu.sse3=off")
28 func TestSSE3DebugOption(t *testing.T) {
29 MustHaveDebugOptionsSupport(t)
31 if godebug.New("cpu.sse3").Value() != "off" {
32 t.Skipf("skipping test: GODEBUG=cpu.sse3=off not set")
36 if got := X86.HasSSE3; got != want {
37 t.Errorf("X86.HasSSE3 expected %v, got %v", want, got)