| Kevin Enderby | a59824a | 2015-10-06 22:27:08 +0000 | [diff] [blame] | 1 | // These test checks that llvm-objdump will not crash with malformed Mach-O |
| 2 | // files. So the check line is not all that important but the bug fixes to |
| 3 | // make sure llvm-objdump is robust is what matters. |
| Kevin Enderby | c614d28 | 2016-08-12 20:10:25 +0000 | [diff] [blame] | 4 | # RUN: not llvm-objdump -macho -objc-meta-data \ |
| 5 | # RUN: %p/Inputs/malformed-machos/mem-crup-0001.macho 2>&1 \ |
| Kevin Enderby | a59824a | 2015-10-06 22:27:08 +0000 | [diff] [blame] | 6 | # RUN: | FileCheck -check-prefix=m0001 %s |
| 7 | |
| Kevin Enderby | c614d28 | 2016-08-12 20:10:25 +0000 | [diff] [blame] | 8 | # m0001: mem-crup-0001.macho': truncated or malformed object (addr field plus size of section 2 in LC_SEGMENT_64 command 0 greater than than the segment's vmaddr plus vmsize) |
| Kevin Enderby | a59824a | 2015-10-06 22:27:08 +0000 | [diff] [blame] | 9 | |
| Colin LeMahieu | efe3732 | 2016-04-08 18:15:37 +0000 | [diff] [blame] | 10 | # RUN: llvm-objdump -macho -objc-meta-data \ |
| Kevin Enderby | a59824a | 2015-10-06 22:27:08 +0000 | [diff] [blame] | 11 | # RUN: %p/Inputs/malformed-machos/mem-crup-0006.macho \ |
| 12 | # RUN: | FileCheck -check-prefix=m0006 %s |
| 13 | |
| 14 | # m0006: ivarLayout 0x8 |
| Kevin Enderby | aac7538 | 2015-10-08 16:56:35 +0000 | [diff] [blame] | 15 | |
| Colin LeMahieu | efe3732 | 2016-04-08 18:15:37 +0000 | [diff] [blame] | 16 | # RUN: llvm-objdump -macho -objc-meta-data \ |
| Kevin Enderby | aac7538 | 2015-10-08 16:56:35 +0000 | [diff] [blame] | 17 | # RUN: %p/Inputs/malformed-machos/mem-crup-0006.macho \ |
| 18 | # RUN: | FileCheck -check-prefix=m0010 %s |
| 19 | |
| 20 | # m0010: 00000000000010e0 0x10e8 _OBJC_CLASS_ |
| Kevin Enderby | 46e642f | 2015-10-08 22:50:55 +0000 | [diff] [blame] | 21 | |
| Kevin Enderby | c614d28 | 2016-08-12 20:10:25 +0000 | [diff] [blame] | 22 | # RUN: not llvm-objdump -macho -objc-meta-data \ |
| 23 | # RUN: %p/Inputs/malformed-machos/mem-crup-0040.macho 2>&1 \ |
| Kevin Enderby | 46e642f | 2015-10-08 22:50:55 +0000 | [diff] [blame] | 24 | # RUN: | FileCheck -check-prefix=m0040 %s |
| 25 | |
| Kevin Enderby | c614d28 | 2016-08-12 20:10:25 +0000 | [diff] [blame] | 26 | # m0040: mem-crup-0040.macho': truncated or malformed object (offset field plus size field of section 2 in LC_SEGMENT_64 command 1 extends past the end of the file) |
| Kevin Enderby | af7c9d0 | 2015-10-09 16:48:44 +0000 | [diff] [blame] | 27 | |
| Kevin Enderby | c614d28 | 2016-08-12 20:10:25 +0000 | [diff] [blame] | 28 | # RUN: not llvm-objdump -macho -objc-meta-data \ |
| 29 | # RUN: %p/Inputs/malformed-machos/mem-crup-0080.macho 2>&1 \ |
| Kevin Enderby | af7c9d0 | 2015-10-09 16:48:44 +0000 | [diff] [blame] | 30 | # RUN: | FileCheck -check-prefix=m0080 %s |
| 31 | |
| Kevin Enderby | c614d28 | 2016-08-12 20:10:25 +0000 | [diff] [blame] | 32 | # m0080: mem-crup-0080.macho': truncated or malformed object (addr field plus size of section 2 in LC_SEGMENT_64 command 1 greater than than the segment's vmaddr plus vmsize) |
| Kevin Enderby | af7c9d0 | 2015-10-09 16:48:44 +0000 | [diff] [blame] | 33 | |
| Colin LeMahieu | efe3732 | 2016-04-08 18:15:37 +0000 | [diff] [blame] | 34 | # RUN: llvm-objdump -macho -objc-meta-data \ |
| Kevin Enderby | d1c66dd | 2015-10-13 17:06:34 +0000 | [diff] [blame] | 35 | # RUN: %p/Inputs/malformed-machos/mem-crup-0261.macho |
| 36 | |
| Colin LeMahieu | efe3732 | 2016-04-08 18:15:37 +0000 | [diff] [blame] | 37 | # RUN: llvm-objdump -macho -disassemble \ |
| Kevin Enderby | d90a417 | 2015-10-10 00:05:01 +0000 | [diff] [blame] | 38 | # RUN: %p/Inputs/malformed-machos/mem-crup-0337.macho \ |
| 39 | # RUN: | FileCheck -check-prefix=m0337 %s |
| 40 | |
| 41 | # m0337: subq $16, %rsp |