Source file
src/internal/cpu/cpu_x86_test.go
1
2
3
4
5
6
7 package cpu_test
8
9 import (
10 . "internal/cpu"
11 "internal/godebug"
12 "testing"
13 )
14
15 func TestX86ifAVX2hasAVX(t *testing.T) {
16 if X86.HasAVX2 && !X86.HasAVX {
17 t.Fatalf("HasAVX expected true when HasAVX2 is true, got false")
18 }
19 }
20
21 func TestDisableSSE3(t *testing.T) {
22 runDebugOptionsTest(t, "TestSSE3DebugOption", "cpu.sse3=off")
23 }
24
25 func TestSSE3DebugOption(t *testing.T) {
26 MustHaveDebugOptionsSupport(t)
27
28 if godebug.Get("cpu.sse3") != "off" {
29 t.Skipf("skipping test: GODEBUG=cpu.sse3=off not set")
30 }
31
32 want := false
33 if got := X86.HasSSE3; got != want {
34 t.Errorf("X86.HasSSE3 expected %v, got %v", want, got)
35 }
36 }
37
View as plain text