summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools/llvm-objdump/X86/disasm-specific-funcs.test
diff options
context:
space:
mode:
authorRafael Auler <rafaelauler@fb.com>2018-03-09 19:13:44 +0000
committerRafael Auler <rafaelauler@fb.com>2018-03-09 19:13:44 +0000
commitb0e4b91660f4c04f9abf5022de547479282af9ca (patch)
tree98503c1f80b6b087e64188a84858ddf94e350590 /llvm/test/tools/llvm-objdump/X86/disasm-specific-funcs.test
parent2974856ad4326989052f04299affaa516985e77a (diff)
downloadbcm5719-llvm-b0e4b91660f4c04f9abf5022de547479282af9ca.tar.gz
bcm5719-llvm-b0e4b91660f4c04f9abf5022de547479282af9ca.zip
[llvm-objdump] Support disassembling by symbol name
Summary: Add a new option -df to llvm-objdump that takes function names as arguments and instructs the disassembler to only dump those function contents. Based on code originally written by Bill Nell. Reviewers: espindola, JDevlieghere Differential Revision: https://reviews.llvm.org/D44224 llvm-svn: 327164
Diffstat (limited to 'llvm/test/tools/llvm-objdump/X86/disasm-specific-funcs.test')
-rw-r--r--llvm/test/tools/llvm-objdump/X86/disasm-specific-funcs.test20
1 files changed, 20 insertions, 0 deletions
diff --git a/llvm/test/tools/llvm-objdump/X86/disasm-specific-funcs.test b/llvm/test/tools/llvm-objdump/X86/disasm-specific-funcs.test
new file mode 100644
index 00000000000..c46147fbe27
--- /dev/null
+++ b/llvm/test/tools/llvm-objdump/X86/disasm-specific-funcs.test
@@ -0,0 +1,20 @@
+// RUN: yaml2obj -o %t.out %p/Inputs/simple-executable-x86_64.yaml
+// RUN: llvm-objdump -d %t.out -df=main | FileCheck %s
+
+// CHECK: Disassembly of section .anothertext:
+// CHECK-NEXT: main:
+// CHECK-NEXT: 10: 55 pushq %rbp
+// CHECK-NEXT: 11: 48 89 e5 movq %rsp, %rbp
+// CHECK-NEXT: 14: 48 83 ec 20 subq $32, %rsp
+// CHECK-NEXT: 18: 48 8d 04 25 a8 00 00 00 leaq 168, %rax
+// CHECK-NEXT: 20: c7 45 fc 00 00 00 00 movl $0, -4(%rbp)
+// CHECK-NEXT: 27: 48 89 45 f0 movq %rax, -16(%rbp)
+// CHECK-NEXT: 2b: 48 8b 45 f0 movq -16(%rbp), %rax
+// CHECK-NEXT: 2f: 8b 08 movl (%rax), %ecx
+// CHECK-NEXT: 31: 89 4d ec movl %ecx, -20(%rbp)
+// CHECK-NEXT: 34: e8 c7 ff ff ff callq -57
+// CHECK-NEXT: 39: 8b 4d ec movl -20(%rbp), %ecx
+// CHECK-NEXT: 3c: 01 c1 addl %eax, %ecx
+// CHECK-NEXT: 3e: 89 c8 movl %ecx, %eax
+// CHECK-NEXT: 40: 48 83 c4 20 addq $32, %rsp
+// CHECK-NEXT: 44: 5d popq %rbp
OpenPOWER on IntegriCloud