github.com/tetratelabs/wazero@v1.7.3-0.20240513003603-48f702e154b5/internal/platform/cpuid_amd64_test.go (about)

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