1 // No crash, might not be totally invalid
2 RUN: llvm-objdump -private-headers %p/Inputs/macho-invalid-zero-ncmds
4 RUN: not llvm-objdump -private-headers %p/Inputs/macho64-invalid-incomplete-load-command 2>&1 \
5 RUN: | FileCheck -check-prefix INCOMPLETE-LOADC %s
6 INCOMPLETE-LOADC: Invalid data was encountered while parsing the file.
8 RUN: not llvm-objdump -private-headers %p/Inputs/macho-invalid-too-small-load-command 2>&1 \
9 RUN: | FileCheck -check-prefix SMALL-LOADC-SIZE %s
10 RUN: not llvm-objdump -private-headers %p/Inputs/macho64-invalid-too-small-load-command 2>&1 \
11 RUN: | FileCheck -check-prefix SMALL-LOADC-SIZE %s
12 SMALL-LOADC-SIZE: Mach-O load command with size < 8 bytes
14 RUN: not llvm-objdump -private-headers %p/Inputs/macho-invalid-too-small-segment-load-command 2>&1 \
15 RUN: | FileCheck -check-prefix SMALL-SEGLOADC-SIZE %s
16 RUN: not llvm-objdump -private-headers %p/Inputs/macho64-invalid-too-small-segment-load-command 2>&1 \
17 RUN: | FileCheck -check-prefix SMALL-SEGLOADC-SIZE %s
18 SMALL-SEGLOADC-SIZE: Mach-O segment load command size is too small
20 RUN: not llvm-objdump -private-headers %p/Inputs/macho-invalid-no-size-for-sections 2>&1 \
21 RUN: | FileCheck -check-prefix TOO-MANY-SECTS %s
22 RUN: not llvm-objdump -private-headers %p/Inputs/macho64-invalid-no-size-for-sections 2>&1 \
23 RUN: | FileCheck -check-prefix TOO-MANY-SECTS %s
24 TOO-MANY-SECTS: Mach-O segment load command contains too many sections
26 RUN: not llvm-objdump -t %p/Inputs/macho-invalid-bad-symbol-index 2>&1 \
27 RUN: | FileCheck -check-prefix BAD-SYMBOL %s
28 BAD-SYMBOL: Requested symbol index is out of range
30 RUN: not llvm-objdump -t %p/Inputs/macho-invalid-symbol-name-past-eof 2>&1 \
31 RUN: | FileCheck -check-prefix NAME-PAST-EOF %s
32 NAME-PAST-EOF: Symbol name entry points before beginning or past end of file
34 RUN: not llvm-nm %p/Inputs/macho-invalid-section-index-getSectionRawName 2>&1 \
35 RUN: | FileCheck -check-prefix INVALID-SECTION-IDX-SYMBOL-SEC %s
36 INVALID-SECTION-IDX-SYMBOL-SEC: getSymbolSection: Invalid section index
38 RUN: not llvm-objdump -private-headers %p/Inputs/macho-invalid-header 2>&1 | FileCheck -check-prefix INVALID-HEADER %s
39 INVALID-HEADER: Invalid data was encountered while parsing the file
41 RUN: not llvm-objdump -private-headers %p/Inputs/macho64-invalid-incomplete-segment-load-command 2>&1 | FileCheck -check-prefix INCOMPLETE-SEGMENT-LOADC %s
42 INCOMPLETE-SEGMENT-LOADC: Invalid data was encountered while parsing the file