blob: c98d08ca21d61d7577478bf1c1a472eb725a3dfa [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.
4# RUN: llvm-objdump -macho -objc-meta-data \
5# RUN: %p/Inputs/malformed-machos/mem-crup-0001.macho \
6# RUN: | FileCheck -check-prefix=m0001 %s
7
8# m0001: (method_t extends past the end of the section)
9
10# RUN: llvm-objdump -macho -objc-meta-data \
11# 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
16# RUN: llvm-objdump -macho -objc-meta-data \
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 Enderby46e642f2015-10-08 22:50:55 +000021
22# RUN: llvm-objdump -macho -objc-meta-data \
23# RUN: %p/Inputs/malformed-machos/mem-crup-0040.macho \
24# RUN: | FileCheck -check-prefix=m0040 %s
25
26# m0040: 00000000000010a0 0xf39 -[tiny_dylib init]
Kevin Enderbyaf7c9d02015-10-09 16:48:44 +000027
28# RUN: llvm-objdump -macho -objc-meta-data \
29# RUN: %p/Inputs/malformed-machos/mem-crup-0080.macho \
30# RUN: | FileCheck -check-prefix=m0080 %s
31
32# m0080: data 0xf960000 (struct class_ro_t *)
33
Kevin Enderbyd1c66dd2015-10-13 17:06:34 +000034# RUN: llvm-objdump -macho -objc-meta-data \
35# RUN: %p/Inputs/malformed-machos/mem-crup-0261.macho
36
Kevin Enderbyd90a4172015-10-10 00:05:01 +000037# RUN: llvm-objdump -macho -disassemble \
38# RUN: %p/Inputs/malformed-machos/mem-crup-0337.macho \
39# RUN: | FileCheck -check-prefix=m0337 %s
40
41# m0337: subq $16, %rsp
Kevin Enderbyd1c66dd2015-10-13 17:06:34 +000042
43# RUN: llvm-objdump -arch x86_64 -macho -disassemble \
44# RUN: %p/Inputs/malformed-machos/00000031.a \
45# RUN: | FileCheck -check-prefix=0031a %s
46
47# 0031a: Archive
48