arm64/arm64asm: use llvm-objdump for objdump tests on openbsd The GNU objdump that ships with openbsd/arm64 is old and not fully functional. Use llvm-objdump instead. Change-Id: I500e93b01445266245c4f66e936faf380c5fd337 Reviewed-on: https://go-review.googlesource.com/c/arch/+/805181 LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Carlos Amedee <carlos@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Carlos Amedee <carlos@golang.org>
diff --git a/arm64/arm64asm/objdumpext_test.go b/arm64/arm64asm/objdumpext_test.go index 3bf4fa8..8fc71c7 100644 --- a/arm64/arm64asm/objdumpext_test.go +++ b/arm64/arm64asm/objdumpext_test.go
@@ -15,12 +15,19 @@ "log" "os" "os/exec" + "runtime" "strconv" "strings" "testing" ) -const objdumpPath = "/usr/bin/objdump" +var objdumpPath = "/usr/bin/objdump" + +func init() { + if runtime.GOOS == "openbsd" { + objdumpPath = "/usr/bin/llvm-objdump" + } +} func testObjdumpARM64(t *testing.T, generate func(func([]byte))) { testObjdumpArch(t, generate, ModeARM64)