github.com/wasilibs/wazerox@v0.0.0-20240124024944-4923be63ab5f/internal/platform/cpuid_amd64_test.go (about)

     1  package platform
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/wasilibs/wazerox/internal/testing/require"
     7  )
     8  
     9  func TestAmd64CpuId_cpuHasFeature(t *testing.T) {
    10  	flags := cpuFeatureFlags{
    11  		flags:      CpuFeatureSSE3,
    12  		extraFlags: CpuExtraFeatureABM,
    13  	}
    14  	require.True(t, flags.Has(CpuFeatureSSE3))
    15  	require.False(t, flags.Has(CpuFeatureSSE4_2))
    16  	require.True(t, flags.HasExtra(CpuExtraFeatureABM))
    17  	require.False(t, flags.HasExtra(1<<6)) // some other value
    18  }