Filipe Cabecinhas | 4013950 | 2015-01-15 22:52:38 +0000 | [diff] [blame] | 1 | // No crash, might not be totally invalid |
| 2 | RUN: llvm-objdump -private-headers %p/Inputs/macho-invalid-zero-ncmds |
| 3 | |
| 4 | RUN: not llvm-objdump -private-headers %p/Inputs/macho64-invalid-incomplete-load-command 2>&1 \ |
| 5 | RUN: | FileCheck -check-prefix INCOMPLETE-LOADC %s |
Alexey Samsonov | de5a94a | 2015-06-04 19:57:46 +0000 | [diff] [blame] | 6 | INCOMPLETE-LOADC: Invalid data was encountered while parsing the file. |
Filipe Cabecinhas | 4013950 | 2015-01-15 22:52:38 +0000 | [diff] [blame] | 7 | |
| 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 |
Alexey Samsonov | de5a94a | 2015-06-04 19:57:46 +0000 | [diff] [blame] | 12 | SMALL-LOADC-SIZE: Mach-O load command with size < 8 bytes |
Filipe Cabecinhas | 4013950 | 2015-01-15 22:52:38 +0000 | [diff] [blame] | 13 | |
| 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 |
Alexey Samsonov | 074da9b | 2015-06-04 20:08:52 +0000 | [diff] [blame] | 18 | SMALL-SEGLOADC-SIZE: Mach-O segment load command size is too small |
Filipe Cabecinhas | 4013950 | 2015-01-15 22:52:38 +0000 | [diff] [blame] | 19 | |
| 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 |
Alexey Samsonov | 074da9b | 2015-06-04 20:08:52 +0000 | [diff] [blame] | 24 | TOO-MANY-SECTS: Mach-O segment load command contains too many sections |
Filipe Cabecinhas | 4013950 | 2015-01-15 22:52:38 +0000 | [diff] [blame] | 25 | |
| 26 | RUN: not llvm-objdump -t %p/Inputs/macho-invalid-bad-symbol-index 2>&1 \ |
| 27 | RUN: | FileCheck -check-prefix BAD-SYMBOL %s |
Alexey Samsonov | 2b5fe3f | 2015-06-04 18:50:04 +0000 | [diff] [blame] | 28 | BAD-SYMBOL: Requested symbol index is out of range |
Filipe Cabecinhas | 4013950 | 2015-01-15 22:52:38 +0000 | [diff] [blame] | 29 | |
| 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 |
Alexey Samsonov | 2b5fe3f | 2015-06-04 18:50:04 +0000 | [diff] [blame] | 32 | NAME-PAST-EOF: Symbol name entry points before beginning or past end of file |
Filipe Cabecinhas | 4013950 | 2015-01-15 22:52:38 +0000 | [diff] [blame] | 33 | |
Filipe Cabecinhas | 4013950 | 2015-01-15 22:52:38 +0000 | [diff] [blame] | 34 | RUN: not llvm-nm %p/Inputs/macho-invalid-section-index-getSectionRawName 2>&1 \ |
Rafael Espindola | 0d85d10 | 2015-05-22 14:59:27 +0000 | [diff] [blame] | 35 | RUN: | FileCheck -check-prefix INVALID-SECTION-IDX-SYMBOL-SEC %s |
Rafael Espindola | 0d85d10 | 2015-05-22 14:59:27 +0000 | [diff] [blame] | 36 | INVALID-SECTION-IDX-SYMBOL-SEC: getSymbolSection: Invalid section index |
Alexey Samsonov | 9f33663 | 2015-06-04 19:45:22 +0000 | [diff] [blame] | 37 | |
| 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 |
Alexey Samsonov | f8a7bf8 | 2015-06-04 22:26:44 +0000 | [diff] [blame^] | 40 | |
| 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 |