aboutsummaryrefslogtreecommitdiff
path: root/llvm/test/tools/llvm-objdump/MachO/function-starts.test
blob: 0e0cce7aa06de49614eeb710ec54c231757e7f90 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
## This test verifies that llvm-objdump correctly prints function starts data.

## Note: we read input from stdin instead of from a file, because llvm-objdump prints
## the filename in its output. If the filename contains the string "_main", then the
## check will incorrectly get triggered. 

RUN: llvm-objdump --macho --function-starts - < %p/Inputs/hello.exe.macho-i386 | FileCheck %s --check-prefix=32-BIT --implicit-check-not=_main
RUN: llvm-objdump --macho --function-starts=addrs - < %p/Inputs/hello.exe.macho-i386 | FileCheck %s --check-prefix=32-BIT --implicit-check-not=_main
32-BIT: 00001f40

RUN: llvm-objdump --macho --function-starts=names - < %p/Inputs/hello.exe.macho-i386 | FileCheck %s --check-prefix=32-BIT-NAMES
32-BIT-NAMES: {{^}}_main

RUN: llvm-objdump --macho --function-starts=both - < %p/Inputs/hello.exe.macho-i386 | FileCheck %s --check-prefix=32-BIT-BOTH
32-BIT-BOTH: 00001f40 _main

RUN: llvm-objdump --macho --function-starts - < %p/Inputs/hello.exe.macho-x86_64 | FileCheck %s --check-prefix=64-BIT --implicit-check-not=_main
RUN: llvm-objdump --macho --function-starts=addrs - < %p/Inputs/hello.exe.macho-x86_64 | FileCheck %s --check-prefix=64-BIT --implicit-check-not=_main
64-BIT: 0000000100000f30

RUN: llvm-objdump --macho --function-starts=names - < %p/Inputs/hello.exe.macho-x86_64 | FileCheck %s --check-prefix=64-BIT-NAMES
64-BIT-NAMES: {{^}}_main

RUN: llvm-objdump --macho --function-starts=both - < %p/Inputs/hello.exe.macho-x86_64 | FileCheck %s --check-prefix=64-BIT-BOTH
64-BIT-BOTH: 0000000100000f30 _main

RUN: llvm-strip  %p/Inputs/hello.exe.macho-x86_64 -o %t.stripped
RUN: llvm-objdump --macho --function-starts=both - < %t.stripped | FileCheck %s --check-prefix=BOTH-STRIPPED
BOTH-STRIPPED: 0000000100000f30 ?

RUN: llvm-strip %p/Inputs/hello.exe.macho-x86_64 -o %t.stripped
RUN: llvm-objdump --macho --function-starts=names - < %t.stripped | FileCheck %s --check-prefix=NAMES-STRIPPED
NAMES-STRIPPED: -:
NAMES-STRIPPED-EMPTY: