2015-10-06 22:27:08 +00:00
// These test checks that llvm-objdump will not crash with malformed Mach-O
// files. So the check line is not all that important but the bug fixes to
// make sure llvm-objdump is robust is what matters.
2016-08-12 20:10:25 +00:00
# RUN: not llvm-objdump -macho -objc-meta-data \
# RUN: %p/Inputs/malformed-machos/mem-crup-0001.macho 2>&1 \
2015-10-06 22:27:08 +00:00
# RUN: | FileCheck -check-prefix=m0001 %s
2016-08-12 20:10:25 +00:00
# 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)
2015-10-06 22:27:08 +00:00
2016-04-08 18:15:37 +00:00
# RUN: llvm-objdump -macho -objc-meta-data \
2015-10-06 22:27:08 +00:00
# RUN: %p/Inputs/malformed-machos/mem-crup-0006.macho \
# RUN: | FileCheck -check-prefix=m0006 %s
# m0006: ivarLayout 0x8
2015-10-08 16:56:35 +00:00
2016-04-08 18:15:37 +00:00
# RUN: llvm-objdump -macho -objc-meta-data \
2015-10-08 16:56:35 +00:00
# RUN: %p/Inputs/malformed-machos/mem-crup-0006.macho \
# RUN: | FileCheck -check-prefix=m0010 %s
# m0010: 00000000000010e0 0x10e8 _OBJC_CLASS_
2015-10-08 22:50:55 +00:00
2016-08-12 20:10:25 +00:00
# RUN: not llvm-objdump -macho -objc-meta-data \
# RUN: %p/Inputs/malformed-machos/mem-crup-0040.macho 2>&1 \
2015-10-08 22:50:55 +00:00
# RUN: | FileCheck -check-prefix=m0040 %s
2016-08-12 20:10:25 +00:00
# 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)
2015-10-09 16:48:44 +00:00
2016-08-12 20:10:25 +00:00
# RUN: not llvm-objdump -macho -objc-meta-data \
# RUN: %p/Inputs/malformed-machos/mem-crup-0080.macho 2>&1 \
2015-10-09 16:48:44 +00:00
# RUN: | FileCheck -check-prefix=m0080 %s
2016-08-12 20:10:25 +00:00
# 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)
2015-10-09 16:48:44 +00:00
2016-04-08 18:15:37 +00:00
# RUN: llvm-objdump -macho -objc-meta-data \
2015-10-13 17:06:34 +00:00
# RUN: %p/Inputs/malformed-machos/mem-crup-0261.macho
2016-04-08 18:15:37 +00:00
# RUN: llvm-objdump -macho -disassemble \
2015-10-10 00:05:01 +00:00
# RUN: %p/Inputs/malformed-machos/mem-crup-0337.macho \
# RUN: | FileCheck -check-prefix=m0337 %s
# m0337: subq $16, %rsp