cmd/objdump: test disassembly on ARM and ARM64

We support disassembly on both ARM and ARM64. Tests are only
enabled on one or the other. This CL enables both.

Change-Id: If89d78b975c241c2b14f72b714dcdc771b4b382c
Reviewed-on: https://go-review.googlesource.com/c/go/+/226459
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
This commit is contained in:
Cherry Zhang 2020-03-30 15:11:52 -04:00
parent 14ad23d1f5
commit 16237b22a8
1 changed files with 12 additions and 6 deletions

View File

@ -58,7 +58,7 @@ func buildObjdump() error {
return nil
}
var x86Need = []string{
var x86Need = []string{ // for both 386 and AMD64
"JMP main.main(SB)",
"CALL main.Println(SB)",
"RET",
@ -82,7 +82,13 @@ var armNeed = []string{
"RET",
}
var arm64GnuNeed = []string{
var arm64Need = []string{
"JMP main.main(SB)",
"CALL main.Println(SB)",
"RET",
}
var armGnuNeed = []string{ // for both ARM and AMR64
"ldr",
"bl",
"cmp",
@ -153,6 +159,8 @@ func testDisasm(t *testing.T, printCode bool, printGnuAsm bool, flags ...string)
need = append(need, x86Need...)
case "arm":
need = append(need, armNeed...)
case "arm64":
need = append(need, arm64Need...)
case "ppc64", "ppc64le":
need = append(need, ppcNeed...)
}
@ -163,8 +171,8 @@ func testDisasm(t *testing.T, printCode bool, printGnuAsm bool, flags ...string)
need = append(need, amd64GnuNeed...)
case "386":
need = append(need, i386GnuNeed...)
case "arm64":
need = append(need, arm64GnuNeed...)
case "arm", "arm64":
need = append(need, armGnuNeed...)
case "ppc64", "ppc64le":
need = append(need, ppcGnuNeed...)
}
@ -234,8 +242,6 @@ func TestDisasmGnuAsm(t *testing.T) {
switch runtime.GOARCH {
case "mips", "mipsle", "mips64", "mips64le", "riscv64", "s390x":
t.Skipf("skipping on %s, issue 19160", runtime.GOARCH)
case "arm":
t.Skipf("skipping gnuAsm test on %s", runtime.GOARCH)
}
testDisasm(t, false, true)
}