Debian Codegraph @

tests/alloc/zeroing/zeroing_test.go

raw symbols SCIP
1 package zeroing
2
3 import (
4 "testing"
5
6 "golang.org/x/sys/cpu"
7 )
8
9 //go:generate go run asm.go -out zeroing.s -stubs stub.go
10
11 func TestZeroing(t *testing.T) {
12 const (
13 n = 32
14 expect = n * (n + 1) / 2
15 )
16
17 if !cpu.X86.HasAVX512F {
18 t.Skip("require AVX512F")
19 }
20
21 var got [8]uint64
22 Zeroing(&got)
23
24 for i := 0; i < 8; i++ {
25 if got[i] != expect {
26 t.Errorf("got[%d] = %d; expect %d", i, got[i], expect)
27 }
28 }
29 }