llvm-project/llvm/test/tools/llvm-objdump/X86/disassemble-align.s
Igor Kudrin d25e572421 [llvm-objdump] Print memory operand addresses as regular comments
The patch reuses the common code to print memory operand addresses as
instruction comments. This helps to align the comments and enables using
target-specific comment markers when `evaluateMemoryOperandAddress()` is
implemented for them.

Differential Revision: https://reviews.llvm.org/D104861
2021-06-28 14:25:22 +07:00

33 lines
1.5 KiB
ArmAsm

# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t
# Use '|' to show where the tabs line up.
# RUN: llvm-objdump -d --print-imm-hex %t | tr '\t' '|' | \
# RUN: FileCheck --match-full-lines --strict-whitespace %s
# RUN: llvm-objdump -d --print-imm-hex --no-show-raw-insn %t | tr '\t' '|' | \
# RUN: FileCheck -check-prefix=NORAW --match-full-lines -strict-whitespace %s
# Instructions are expected to be aligned if the instruction in hex is not too long.
# CHECK: 0: c3 |retq
# CHECK-NEXT: 1: 48 8b 05 56 34 12 00 |movq|0x123456(%rip), %rax # 0x12345e <.text+0x12345e>
# CHECK-NEXT: 8: 48 b8 54 55 55 55 55 55 55 55|movabsq|$0x5555555555555554, %rax # imm = 0x5555555555555554
# CHECK-NEXT: 12: 8f ea 00 12 4c 02 40 00 00 00 00 |lwpval|$0x0, 0x40(%rdx,%rax), %r15d
# CHECK-NEXT: 1d: 8f ea 00 12 04 25 f0 1c f0 1c 00 00 00 00 |lwpins|$0x0, 0x1cf01cf0, %r15d
# CHECK-NEXT: 2b: ff ff |<unknown>
# NORAW: 0: |retq
# NORAW-NEXT: 1: |movq|0x123456(%rip), %rax # 0x12345e <.text+0x12345e>
# NORAW-NEXT: 8: |movabsq|$0x5555555555555554, %rax # imm = 0x5555555555555554
# NORAW-NEXT: 12: |lwpval|$0x0, 0x40(%rdx,%rax), %r15d
# NORAW-NEXT: 1d: |lwpins|$0x0, 0x1cf01cf0, %r15d
# NORAW-NEXT: 2b: |<unknown>
.text
retq
movq 0x123456(%rip),%rax
movabs $0x5555555555555554,%rax
lwpval $0x0, 0x40(%rdx,%rax), %r15d
lwpins $0x0, 0x1cf01cf0, %r15d
.word 0xffff