golang.org/x/sys@v0.9.0/cpu/runtime_auxv_go121_test.go (about)

     1  // Copyright 2023 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  //go:build go1.21
     6  // +build go1.21
     7  
     8  package cpu
     9  
    10  import (
    11  	"runtime"
    12  	"testing"
    13  )
    14  
    15  func TestAuxvFromRuntime(t *testing.T) {
    16  	got := getAuxv()
    17  	t.Logf("got: %v", got) // notably: we didn't panic
    18  	if runtime.GOOS == "linux" && len(got) == 0 {
    19  		t.Errorf("expected auxv on linux; got zero entries")
    20  	}
    21  }