ppc64/ppc64asm: fix objdump tests

In short, these tests create an object file from a list of opcodes,
and expect objdump to generate exactly as many decoded opcodes.

Unfortunately, objdump generates two opcode entries for each invalid
prefixed instruction, which causes the the testing code to deadlock
itself.

For example, objdump decodes an invalid form of paddi like:

    .long ...
    addi ...

instead of something like:

    .quadword ...

Work around this by examing the primary opcode of any entry which
objdump reports as ".long", and skip over the next word if the
primary opcode is "1" (the prefix opcode). The test skips over
".long" entries, so it will continue to work as expected.

Change-Id: I9dd0fda10683f666aace4140b63e81fc0fea2ad0
Reviewed-on: https://go-review.googlesource.com/c/arch/+/418857
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Paul Murphy <murp@ibm.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2 files changed
tree: 4e0a7d33d9929b44db77e5a576aa1e797a530c95
  1. arm/
  2. arm64/
  3. ppc64/
  4. x86/
  5. codereview.cfg
  6. CONTRIBUTING.md
  7. go.mod
  8. go.sum
  9. LICENSE
  10. PATENTS
  11. README.md
README.md

arch

Go Reference

This repository holds machine architecture information used by the Go toolchain. The parts needed in the main Go repository are copied in.

Report Issues / Send Patches

This repository uses Gerrit for code changes. To learn how to submit changes to this repository, see https://golang.org/doc/contribute.html.

The main issue tracker for the arch repository is located at https://github.com/golang/go/issues. Prefix your issue with “x/arch:” in the subject line, so it is easy to find.