2015-01-16 06:52:38 +08:00
|
|
|
// No crash, might not be totally invalid
|
|
|
|
RUN: llvm-objdump -private-headers %p/Inputs/macho-invalid-zero-ncmds
|
|
|
|
|
|
|
|
RUN: not llvm-objdump -private-headers %p/Inputs/macho64-invalid-incomplete-load-command 2>&1 \
|
|
|
|
RUN: | FileCheck -check-prefix INCOMPLETE-LOADC %s
|
2015-06-05 03:57:46 +08:00
|
|
|
INCOMPLETE-LOADC: Invalid data was encountered while parsing the file.
|
2015-01-16 06:52:38 +08:00
|
|
|
|
|
|
|
RUN: not llvm-objdump -private-headers %p/Inputs/macho-invalid-too-small-load-command 2>&1 \
|
|
|
|
RUN: | FileCheck -check-prefix SMALL-LOADC-SIZE %s
|
|
|
|
RUN: not llvm-objdump -private-headers %p/Inputs/macho64-invalid-too-small-load-command 2>&1 \
|
|
|
|
RUN: | FileCheck -check-prefix SMALL-LOADC-SIZE %s
|
2015-06-05 03:57:46 +08:00
|
|
|
SMALL-LOADC-SIZE: Mach-O load command with size < 8 bytes
|
2015-01-16 06:52:38 +08:00
|
|
|
|
|
|
|
RUN: not llvm-objdump -private-headers %p/Inputs/macho-invalid-too-small-segment-load-command 2>&1 \
|
|
|
|
RUN: | FileCheck -check-prefix SMALL-SEGLOADC-SIZE %s
|
|
|
|
RUN: not llvm-objdump -private-headers %p/Inputs/macho64-invalid-too-small-segment-load-command 2>&1 \
|
|
|
|
RUN: | FileCheck -check-prefix SMALL-SEGLOADC-SIZE %s
|
2015-06-05 02:50:04 +08:00
|
|
|
SMALL-SEGLOADC-SIZE: Segment load command size is too small
|
2015-01-16 06:52:38 +08:00
|
|
|
|
|
|
|
RUN: not llvm-objdump -private-headers %p/Inputs/macho-invalid-no-size-for-sections 2>&1 \
|
|
|
|
RUN: | FileCheck -check-prefix TOO-MANY-SECTS %s
|
|
|
|
RUN: not llvm-objdump -private-headers %p/Inputs/macho64-invalid-no-size-for-sections 2>&1 \
|
|
|
|
RUN: | FileCheck -check-prefix TOO-MANY-SECTS %s
|
2015-06-05 02:50:04 +08:00
|
|
|
TOO-MANY-SECTS: Number of sections too large for size of load command
|
2015-01-16 06:52:38 +08:00
|
|
|
|
|
|
|
RUN: not llvm-objdump -t %p/Inputs/macho-invalid-bad-symbol-index 2>&1 \
|
|
|
|
RUN: | FileCheck -check-prefix BAD-SYMBOL %s
|
2015-06-05 02:50:04 +08:00
|
|
|
BAD-SYMBOL: Requested symbol index is out of range
|
2015-01-16 06:52:38 +08:00
|
|
|
|
|
|
|
RUN: not llvm-objdump -t %p/Inputs/macho-invalid-symbol-name-past-eof 2>&1 \
|
|
|
|
RUN: | FileCheck -check-prefix NAME-PAST-EOF %s
|
2015-06-05 02:50:04 +08:00
|
|
|
NAME-PAST-EOF: Symbol name entry points before beginning or past end of file
|
2015-01-16 06:52:38 +08:00
|
|
|
|
|
|
|
RUN: not llvm-nm %p/Inputs/macho-invalid-section-index-getSectionRawName 2>&1 \
|
2015-05-22 22:59:27 +08:00
|
|
|
RUN: | FileCheck -check-prefix INVALID-SECTION-IDX-SYMBOL-SEC %s
|
|
|
|
INVALID-SECTION-IDX-SYMBOL-SEC: getSymbolSection: Invalid section index
|
2015-06-05 03:45:22 +08:00
|
|
|
|
|
|
|
RUN: not llvm-objdump -private-headers %p/Inputs/macho-invalid-header 2>&1 | FileCheck -check-prefix INVALID-HEADER %s
|
|
|
|
INVALID-HEADER: Invalid data was encountered while parsing the file
|