Files
avo/tests/alloc/zeroing/zeroing_test.go
Michael McLoughlin b985ff5775 ci: bump to go 1.23 (#453)
Upgrade to Go 1.23.

Upgrade also requires bumping `golangci-lint` to v1.62.2, and upgrading
third-party test versions for some failing cases.
2024-12-22 16:01:48 -08:00

30 lines
415 B
Go

package zeroing
import (
"testing"
"golang.org/x/sys/cpu"
)
//go:generate go run asm.go -out zeroing.s -stubs stub.go
func TestZeroing(t *testing.T) {
const (
n = 32
expect = n * (n + 1) / 2
)
if !cpu.X86.HasAVX512F {
t.Skip("require AVX512F")
}
var got [8]uint64
Zeroing(&got)
for i := range 8 {
if got[i] != expect {
t.Errorf("got[%d] = %d; expect %d", i, got[i], expect)
}
}
}