Source file src/simd/testdata/iface/extra.go
1 // Copyright 2026 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 goexperiment.simdstable 6 7 // extra.go is a second file in package iface that intentionally does not import 8 // "simd". It validates that midway injects its private @simd/@bridge imports 9 // and rewrites both SIMD-dependent functions (ExtraSimdLen) and package-level 10 // variable initializers (ExtraSimdInit) in files without direct "simd" imports. 11 package iface 12 13 import ( 14 "unsafe" 15 ) 16 17 func makeUnsafePtr(p *int) unsafe.Pointer { 18 return unsafe.Pointer(p) 19 } 20 21 func ExtraSimdLen() int { 22 return Generic[MyInt8s](0) 23 } 24 25 var ExtraSimdInit = Generic[MyInt8s](2) 26