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. 4 5package cpu_test 6 7import ( 8 "runtime" 9 "testing" 10 11 "golang.org/x/sys/cpu" 12) 13 14func TestAMD64minimalFeatures(t *testing.T) { 15 if runtime.GOARCH == "amd64" { 16 if !cpu.X86.HasSSE2 { 17 t.Fatal("HasSSE2 expected true, got false") 18 } 19 } 20} 21 22func TestAVX2hasAVX(t *testing.T) { 23 if runtime.GOARCH == "amd64" { 24 if cpu.X86.HasAVX2 && !cpu.X86.HasAVX { 25 t.Fatal("HasAVX expected true, got false") 26 } 27 } 28} 29