1
0
mirror of https://github.com/golang/go synced 2024-09-24 09:30:13 -06:00

cmd/compile/internal/amd64: fix "missing objdump" skip in TestGoAMD64v1

The skip was erroneously applied to errors from the call to StdoutPipe
instead of Start, and even then was a bit too broad.

Change-Id: I417c9a74692383230fc6d99ebb4149fdc532533e
Reviewed-on: https://go-review.googlesource.com/c/go/+/391800
Trust: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
This commit is contained in:
Bryan C. Mills 2022-03-10 23:30:07 -05:00 committed by Bryan Mills
parent ef7d0413c2
commit 751b8798dd

View File

@ -8,6 +8,7 @@ import (
"bufio"
"debug/elf"
"debug/macho"
"errors"
"fmt"
"internal/testenv"
"io"
@ -115,9 +116,12 @@ func clobber(t *testing.T, src string, dst *os.File, opcodes map[string]bool) {
var err error
disasm, err = cmd.StdoutPipe()
if err != nil {
t.Skipf("can't run test due to missing objdump: %s", err)
t.Fatal(err)
}
if err := cmd.Start(); err != nil {
if errors.Is(err, exec.ErrNotFound) {
t.Skipf("can't run test due to missing objdump: %s", err)
}
t.Fatal(err)
}
re = regexp.MustCompile(`^\s*([0-9a-f]+):\s*((?:[0-9a-f][0-9a-f] )+)\s*([a-z0-9]+)`)