cpu_test.go 525 B

1234567891011121314151617181920212223242526
  1. // Copyright 2017 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. package cpufeat
  5. import (
  6. "runtime"
  7. "testing"
  8. )
  9. func TestAMD64minimalFeatures(t *testing.T) {
  10. if runtime.GOARCH == "amd64" {
  11. if !X86.HasSSE2 {
  12. t.Fatalf("HasSSE2 expected true, got false")
  13. }
  14. }
  15. }
  16. func TestAVX2hasAVX(t *testing.T) {
  17. if runtime.GOARCH == "amd64" {
  18. if X86.HasAVX2 && !X86.HasAVX {
  19. t.Fatalf("HasAVX expected true, got false")
  20. }
  21. }
  22. }