]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/objdump: test disassembly on ARM and ARM64
authorCherry Zhang <cherryyz@google.com>
Mon, 30 Mar 2020 19:11:52 +0000 (15:11 -0400)
committerCherry Zhang <cherryyz@google.com>
Mon, 30 Mar 2020 21:37:12 +0000 (21:37 +0000)
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>
src/cmd/objdump/objdump_test.go

index 5030ec65d28952056d8b311af59567f6f199d4d0..c974d6707bc3b4342116fdb539cc1f1e9acb722a 100644 (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)
 }