github.com/bananabytelabs/wazero@v0.0.0-20240105073314-54b22a776da8/internal/platform/cpuid_amd64_test.go (about)

     1  package platform
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/bananabytelabs/wazero/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  }