|
1 |
| -// RUN: yaml2obj -o %t.out %p/Inputs/simple-executable-x86_64.yaml |
2 |
| -// RUN: llvm-objdump -d %t.out -disassemble-functions=main | FileCheck %s |
| 1 | +## Show that the --diassemble-functions switch disassembles only the specified |
| 2 | +## functions. |
3 | 3 |
|
4 |
| -// CHECK: Disassembly of section .anothertext: |
5 |
| -// CHECK-EMPTY: |
6 |
| -// CHECK-NEXT: main: |
7 |
| -// CHECK-NEXT: 10: 55 pushq %rbp |
8 |
| -// CHECK-NEXT: 11: 48 89 e5 movq %rsp, %rbp |
9 |
| -// CHECK-NEXT: 14: 48 83 ec 20 subq $32, %rsp |
10 |
| -// CHECK-NEXT: 18: 48 8d 04 25 a8 00 00 00 leaq 168, %rax |
11 |
| -// CHECK-NEXT: 20: c7 45 fc 00 00 00 00 movl $0, -4(%rbp) |
12 |
| -// CHECK-NEXT: 27: 48 89 45 f0 movq %rax, -16(%rbp) |
13 |
| -// CHECK-NEXT: 2b: 48 8b 45 f0 movq -16(%rbp), %rax |
14 |
| -// CHECK-NEXT: 2f: 8b 08 movl (%rax), %ecx |
15 |
| -// CHECK-NEXT: 31: 89 4d ec movl %ecx, -20(%rbp) |
16 |
| -// CHECK-NEXT: 34: e8 c7 ff ff ff callq -57 |
17 |
| -// CHECK-NEXT: 39: 8b 4d ec movl -20(%rbp), %ecx |
18 |
| -// CHECK-NEXT: 3c: 01 c1 addl %eax, %ecx |
19 |
| -// CHECK-NEXT: 3e: 89 c8 movl %ecx, %eax |
20 |
| -// CHECK-NEXT: 40: 48 83 c4 20 addq $32, %rsp |
21 |
| -// CHECK-NEXT: 44: 5d popq %rbp |
| 4 | +# RUN: yaml2obj -o %t.out %p/Inputs/simple-executable-x86_64.yaml |
| 5 | +# RUN: llvm-objdump -d %t.out --disassemble-functions=main \ |
| 6 | +# RUN: | FileCheck %s --check-prefix=MAIN --implicit-check-not=foo --implicit-check-not=somedata |
| 7 | +# RUN: llvm-objdump -d %t.out --disassemble-functions=main,foo \ |
| 8 | +# RUN: | FileCheck %s --check-prefixes=MAIN,FOO --implicit-check-not=somedata |
| 9 | + |
| 10 | +# FOO: foo: |
| 11 | +# MAIN: main: |
| 12 | + |
| 13 | +## Unknown symbol name. |
| 14 | +# RUN: llvm-objdump -d %t.out --disassemble-functions=baz \ |
| 15 | +# RUN: | FileCheck %s --implicit-check-not=Disassembly |
| 16 | + |
| 17 | +## Data symbol. |
| 18 | +# RUN: llvm-objdump -d %t.out --disassemble-functions=a \ |
| 19 | +# RUN: | FileCheck %s --implicit-check-not=Disassembly |
| 20 | + |
| 21 | +## Data symbol + --disassemble-all. |
| 22 | +# RUN: llvm-objdump -D %t.out --disassemble-functions=a \ |
| 23 | +# RUN: | FileCheck %s --check-prefix=DATA |
| 24 | + |
| 25 | +# DATA: a: |
0 commit comments