blob: 9ada3ef0abe68d31130cce92d76da4049299e0b7 [file] [log] [blame]
Kevin Enderbya59824a2015-10-06 22:27:08 +00001// 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 Enderbyc614d282016-08-12 20:10:25 +00004# RUN: not llvm-objdump -macho -objc-meta-data \
5# RUN: %p/Inputs/malformed-machos/mem-crup-0001.macho 2>&1 \
Kevin Enderbya59824a2015-10-06 22:27:08 +00006# RUN: | FileCheck -check-prefix=m0001 %s
7
Kevin Enderbyc614d282016-08-12 20:10:25 +00008# 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 Enderbya59824a2015-10-06 22:27:08 +00009
Colin LeMahieuefe37322016-04-08 18:15:37 +000010# RUN: llvm-objdump -macho -objc-meta-data \
Kevin Enderbya59824a2015-10-06 22:27:08 +000011# RUN: %p/Inputs/malformed-machos/mem-crup-0006.macho \
12# RUN: | FileCheck -check-prefix=m0006 %s
13
14# m0006: ivarLayout 0x8
Kevin Enderbyaac75382015-10-08 16:56:35 +000015
Colin LeMahieuefe37322016-04-08 18:15:37 +000016# RUN: llvm-objdump -macho -objc-meta-data \
Kevin Enderbyaac75382015-10-08 16:56:35 +000017# RUN: %p/Inputs/malformed-machos/mem-crup-0006.macho \
18# RUN: | FileCheck -check-prefix=m0010 %s
19
20# m0010: 00000000000010e0 0x10e8 _OBJC_CLASS_
Kevin Enderby46e642f2015-10-08 22:50:55 +000021
Kevin Enderbyc614d282016-08-12 20:10:25 +000022# RUN: not llvm-objdump -macho -objc-meta-data \
23# RUN: %p/Inputs/malformed-machos/mem-crup-0040.macho 2>&1 \
Kevin Enderby46e642f2015-10-08 22:50:55 +000024# RUN: | FileCheck -check-prefix=m0040 %s
25
Kevin Enderbyc614d282016-08-12 20:10:25 +000026# 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 Enderbyaf7c9d02015-10-09 16:48:44 +000027
Kevin Enderbyc614d282016-08-12 20:10:25 +000028# RUN: not llvm-objdump -macho -objc-meta-data \
29# RUN: %p/Inputs/malformed-machos/mem-crup-0080.macho 2>&1 \
Kevin Enderbyaf7c9d02015-10-09 16:48:44 +000030# RUN: | FileCheck -check-prefix=m0080 %s
31
Kevin Enderbyc614d282016-08-12 20:10:25 +000032# 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 Enderbyaf7c9d02015-10-09 16:48:44 +000033
Colin LeMahieuefe37322016-04-08 18:15:37 +000034# RUN: llvm-objdump -macho -objc-meta-data \
Kevin Enderbyd1c66dd2015-10-13 17:06:34 +000035# RUN: %p/Inputs/malformed-machos/mem-crup-0261.macho
36
Colin LeMahieuefe37322016-04-08 18:15:37 +000037# RUN: llvm-objdump -macho -disassemble \
Kevin Enderbyd90a4172015-10-10 00:05:01 +000038# RUN: %p/Inputs/malformed-machos/mem-crup-0337.macho \
39# RUN: | FileCheck -check-prefix=m0337 %s
40
41# m0337: subq $16, %rsp