On Tue, Apr 25, 2023 at 8:38 AM Sam Vilain <s...@vilain.net> wrote: > > I have a module that has a couple of assembly functions (for CLZ aka > BSR/LZCNT, which despite widespread availability[1] don't get any language > support). So I've got the assembly versions in per–arch files, and a "noasm" > version that builds with "noasm" (amongst other typical conditions. > > My question is: is there a way to specify this "noasm" when running 'go test'? > > I tried using `-gcflags -complete`, but now I just get complaints about > missing the function body: > > $ go test -gcflags '-complete' -v . > ... > ./primitives_asm.go:17:6: missing function body > ./primitives_asm.go:20:6: missing function body > FAIL ... > > Is this a bug in the compiler, i.e. should "noasm" always be set with > "-complete", which disables assembly/C ? Or is there some other way to set > 'noasm', like a define flag, that I missed?
Have you considered using the functions in the math/bits package? I don't think you really said exactly how noasm works, but if it's a build tag then the answer is "go test -tags=noasm". The conventional name for a tag like that is "purego". Ian -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAOyqgcWtrQkZPQ3hMkw-qXNNXryteu6KAE7zo2fVeKUD-NK8Jw%40mail.gmail.com.