Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[llvm-objdump] Print comments for the disassembled code
LLVM disassembler can generate comments for disassembled instructions. The patch enables printing these comments for 'llvm-objdump -d'. Differential Revision: https://reviews.llvm.org/D104699
- Loading branch information
1 parent
04242bd
commit abe0fa4
Showing
5 changed files
with
77 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
llvm/test/tools/llvm-objdump/ELF/AArch64/disassemble-print-comments.s
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
## Check that 'llvm-objdump -d' prints comments generated by the disassembler. | ||
|
||
# RUN: llvm-mc -filetype=obj -triple=aarch64 -mattr=+sve %s -o %t | ||
# RUN: llvm-objdump -d --mattr=+sve --no-show-raw-insn %t | FileCheck %s | ||
|
||
# CHECK: 0000000000000000 <foo>: | ||
# CHECK-NEXT: 0: add x0, x2, #2, lsl #12 // =8192 | ||
# CHECK-NEXT: 4: add z31.d, z31.d, #65280 // =0xff00 | ||
|
||
.text | ||
foo: | ||
add x0, x2, 8192 | ||
add z31.d, z31.d, #65280 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
llvm/test/tools/llvm-objdump/X86/disassemble-print-comments.s
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
## Check that 'llvm-objdump -d' prints comments generated by the disassembler. | ||
|
||
# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t | ||
# RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s | ||
|
||
# CHECK: 0000000000000000 <foo>: | ||
# CHECK-NEXT: 0: nop | ||
# CHECK-NEXT: 1: cmpl $305419896, %eax # imm = 0x12345678 | ||
|
||
.text | ||
foo: | ||
nop | ||
cmpl $0x12345678, %eax |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters