github.com/wasilibs/wazerox@v0.0.0-20240124024944-4923be63ab5f/internal/engine/compiler/arch_arm64_test.go (about)

     1  package compiler
     2  
     3  import (
     4  	"testing"
     5  	"unsafe"
     6  
     7  	"github.com/wasilibs/wazerox/internal/testing/require"
     8  )
     9  
    10  func TestArchContextOffsetInArm64Engine(t *testing.T) {
    11  	var ctx callEngine
    12  	require.Equal(t, int(unsafe.Offsetof(ctx.compilerCallReturnAddress)), arm64CallEngineArchContextCompilerCallReturnAddressOffset, "fix consts in compiler_arm64.s")
    13  	require.Equal(t, int(unsafe.Offsetof(ctx.minimum32BitSignedInt)), arm64CallEngineArchContextMinimum32BitSignedIntOffset)
    14  	require.Equal(t, int(unsafe.Offsetof(ctx.minimum64BitSignedInt)), arm64CallEngineArchContextMinimum64BitSignedIntOffset)
    15  }