aboutsummaryrefslogtreecommitdiffstats
path: root/test/tools/llvm-objdump/X86
diff options
context:
space:
mode:
Diffstat (limited to 'test/tools/llvm-objdump/X86')
-rwxr-xr-xtest/tools/llvm-objdump/X86/Inputs/dylibModInit.macho-x86_64bin0 -> 8256 bytes
-rwxr-xr-xtest/tools/llvm-objdump/X86/Inputs/dylibRoutines.macho-x86_64bin0 -> 4288 bytes
-rwxr-xr-xtest/tools/llvm-objdump/X86/Inputs/dylibSubClient.macho-x86_64bin0 -> 4240 bytes
-rwxr-xr-xtest/tools/llvm-objdump/X86/Inputs/dylibSubFramework.macho-x86_64bin0 -> 4240 bytes
-rwxr-xr-xtest/tools/llvm-objdump/X86/Inputs/dylibSubLibrary.macho-x86_64bin0 -> 4220 bytes
-rwxr-xr-xtest/tools/llvm-objdump/X86/Inputs/dylibSubUmbrella.macho-x86_64bin0 -> 4220 bytes
-rwxr-xr-xtest/tools/llvm-objdump/X86/Inputs/exeThread.macho-x86_64bin0 -> 9100 bytes
-rw-r--r--test/tools/llvm-objdump/X86/Inputs/linkerOption.macho-x86_64bin0 -> 744 bytes
-rw-r--r--test/tools/llvm-objdump/X86/Inputs/macho-universal-archive.x86_64.i386bin0 -> 1656 bytes
-rwxr-xr-xtest/tools/llvm-objdump/X86/Inputs/macho-universal.x86_64.i386bin0 -> 16624 bytes
-rw-r--r--test/tools/llvm-objdump/X86/macho-archive-headers.test10
-rw-r--r--test/tools/llvm-objdump/X86/macho-cstring-dump.test4
-rw-r--r--test/tools/llvm-objdump/X86/macho-indirect-symbols.test12
-rw-r--r--test/tools/llvm-objdump/X86/macho-literal-pointers-i386.test34
-rw-r--r--test/tools/llvm-objdump/X86/macho-literal-pointers-x86_64.test34
-rw-r--r--test/tools/llvm-objdump/X86/macho-literals.test48
-rw-r--r--test/tools/llvm-objdump/X86/macho-nontext-disasm.test9
-rw-r--r--test/tools/llvm-objdump/X86/macho-private-headers.test77
-rw-r--r--test/tools/llvm-objdump/X86/macho-relocations.test7
-rw-r--r--test/tools/llvm-objdump/X86/macho-section-contents.test17
-rw-r--r--test/tools/llvm-objdump/X86/macho-section-headers.test8
-rw-r--r--test/tools/llvm-objdump/X86/macho-section.test4
-rw-r--r--test/tools/llvm-objdump/X86/macho-symbol-table.test8
-rw-r--r--test/tools/llvm-objdump/X86/macho-universal-x86_64.i386.test44
-rw-r--r--test/tools/llvm-objdump/X86/macho-unwind-info.test7
25 files changed, 323 insertions, 0 deletions
diff --git a/test/tools/llvm-objdump/X86/Inputs/dylibModInit.macho-x86_64 b/test/tools/llvm-objdump/X86/Inputs/dylibModInit.macho-x86_64
new file mode 100755
index 0000000..a39424a
--- /dev/null
+++ b/test/tools/llvm-objdump/X86/Inputs/dylibModInit.macho-x86_64
Binary files differ
diff --git a/test/tools/llvm-objdump/X86/Inputs/dylibRoutines.macho-x86_64 b/test/tools/llvm-objdump/X86/Inputs/dylibRoutines.macho-x86_64
new file mode 100755
index 0000000..3568045
--- /dev/null
+++ b/test/tools/llvm-objdump/X86/Inputs/dylibRoutines.macho-x86_64
Binary files differ
diff --git a/test/tools/llvm-objdump/X86/Inputs/dylibSubClient.macho-x86_64 b/test/tools/llvm-objdump/X86/Inputs/dylibSubClient.macho-x86_64
new file mode 100755
index 0000000..e7f9542
--- /dev/null
+++ b/test/tools/llvm-objdump/X86/Inputs/dylibSubClient.macho-x86_64
Binary files differ
diff --git a/test/tools/llvm-objdump/X86/Inputs/dylibSubFramework.macho-x86_64 b/test/tools/llvm-objdump/X86/Inputs/dylibSubFramework.macho-x86_64
new file mode 100755
index 0000000..3036c27
--- /dev/null
+++ b/test/tools/llvm-objdump/X86/Inputs/dylibSubFramework.macho-x86_64
Binary files differ
diff --git a/test/tools/llvm-objdump/X86/Inputs/dylibSubLibrary.macho-x86_64 b/test/tools/llvm-objdump/X86/Inputs/dylibSubLibrary.macho-x86_64
new file mode 100755
index 0000000..dafee5f
--- /dev/null
+++ b/test/tools/llvm-objdump/X86/Inputs/dylibSubLibrary.macho-x86_64
Binary files differ
diff --git a/test/tools/llvm-objdump/X86/Inputs/dylibSubUmbrella.macho-x86_64 b/test/tools/llvm-objdump/X86/Inputs/dylibSubUmbrella.macho-x86_64
new file mode 100755
index 0000000..1e42a4f
--- /dev/null
+++ b/test/tools/llvm-objdump/X86/Inputs/dylibSubUmbrella.macho-x86_64
Binary files differ
diff --git a/test/tools/llvm-objdump/X86/Inputs/exeThread.macho-x86_64 b/test/tools/llvm-objdump/X86/Inputs/exeThread.macho-x86_64
new file mode 100755
index 0000000..93fe1db
--- /dev/null
+++ b/test/tools/llvm-objdump/X86/Inputs/exeThread.macho-x86_64
Binary files differ
diff --git a/test/tools/llvm-objdump/X86/Inputs/linkerOption.macho-x86_64 b/test/tools/llvm-objdump/X86/Inputs/linkerOption.macho-x86_64
new file mode 100644
index 0000000..38053c5
--- /dev/null
+++ b/test/tools/llvm-objdump/X86/Inputs/linkerOption.macho-x86_64
Binary files differ
diff --git a/test/tools/llvm-objdump/X86/Inputs/macho-universal-archive.x86_64.i386 b/test/tools/llvm-objdump/X86/Inputs/macho-universal-archive.x86_64.i386
new file mode 100644
index 0000000..1660714
--- /dev/null
+++ b/test/tools/llvm-objdump/X86/Inputs/macho-universal-archive.x86_64.i386
Binary files differ
diff --git a/test/tools/llvm-objdump/X86/Inputs/macho-universal.x86_64.i386 b/test/tools/llvm-objdump/X86/Inputs/macho-universal.x86_64.i386
new file mode 100755
index 0000000..36d5fc2
--- /dev/null
+++ b/test/tools/llvm-objdump/X86/Inputs/macho-universal.x86_64.i386
Binary files differ
diff --git a/test/tools/llvm-objdump/X86/macho-archive-headers.test b/test/tools/llvm-objdump/X86/macho-archive-headers.test
new file mode 100644
index 0000000..3d9043e
--- /dev/null
+++ b/test/tools/llvm-objdump/X86/macho-archive-headers.test
@@ -0,0 +1,10 @@
+RUN: llvm-objdump %p/Inputs/macho-universal-archive.x86_64.i386 -macho -archive-headers -arch all \
+RUN: | FileCheck %s
+
+# Note the date as printed by ctime(3) is time zone dependent and not checked.
+CHECK: Archive : {{.*}}/macho-universal-archive.x86_64.i386 (architecture x86_64)
+CHECK: -rw-r--r--124/11 44 {{.*}} __.SYMDEF SORTED
+CHECK: -rw-r--r--124/0 860 {{.*}} hello.o
+CHECK: Archive : {{.*}}/macho-universal-archive.x86_64.i386 (architecture i386)
+CHECK: -rw-r--r--124/11 60 {{.*}} __.SYMDEF SORTED
+CHECK: -rw-r--r--124/0 388 {{.*}} foo.o
diff --git a/test/tools/llvm-objdump/X86/macho-cstring-dump.test b/test/tools/llvm-objdump/X86/macho-cstring-dump.test
new file mode 100644
index 0000000..3dfa4e3
--- /dev/null
+++ b/test/tools/llvm-objdump/X86/macho-cstring-dump.test
@@ -0,0 +1,4 @@
+RUN: llvm-objdump -m -section __TEXT,__cstring %p/Inputs/hello.obj.macho-x86_64 | FileCheck %s
+
+CHECK: Contents of (__TEXT,__cstring) section
+CHECK: 000000000000003b Hello world\n
diff --git a/test/tools/llvm-objdump/X86/macho-indirect-symbols.test b/test/tools/llvm-objdump/X86/macho-indirect-symbols.test
new file mode 100644
index 0000000..4f3af18
--- /dev/null
+++ b/test/tools/llvm-objdump/X86/macho-indirect-symbols.test
@@ -0,0 +1,12 @@
+RUN: llvm-objdump -macho -indirect-symbols %p/Inputs/hello.exe.macho-x86_64 | FileCheck %s
+
+CHECK: Indirect symbols for (__TEXT,__stubs) 1 entries
+CHECK: address index name
+CHECK: 0x0000000100000f6c 2 _printf
+CHECK: Indirect symbols for (__DATA,__nl_symbol_ptr) 2 entries
+CHECK: address index name
+CHECK: 0x0000000100001000 3 dyld_stub_binder
+CHECK: 0x0000000100001008 ABSOLUTE
+CHECK: Indirect symbols for (__DATA,__la_symbol_ptr) 1 entries
+CHECK: address index name
+CHECK: 0x0000000100001010 2 _printf
diff --git a/test/tools/llvm-objdump/X86/macho-literal-pointers-i386.test b/test/tools/llvm-objdump/X86/macho-literal-pointers-i386.test
new file mode 100644
index 0000000..0069668
--- /dev/null
+++ b/test/tools/llvm-objdump/X86/macho-literal-pointers-i386.test
@@ -0,0 +1,34 @@
+# RUN: llvm-mc < %s -triple i386-apple-darwin -filetype=obj | llvm-objdump -m -section __DATA,__litp - | FileCheck %s
+
+.cstring
+L1: .asciz "Hello world\n"
+
+.literal4
+.align 2
+L2: .float 4.0
+
+.literal8
+.align 3
+L3: .double 8.0
+
+.literal16
+.align 4
+L4: .long 0x10000016, 0x20000016, 0x30000016, 0x40000016
+
+.const
+L5: .asciz "const non-literal string"
+
+.section __DATA,__litp, literal_pointers
+.align 2
+.long L1
+.long L2
+.long L3
+.long L4
+.long L5
+
+# CHECK: Contents of (__DATA,__litp) section
+# CHECK: 0000004c __TEXT:__cstring:Hello world\n
+# CHECK: 00000050 __TEXT:__literal4:0x40800000
+# CHECK: 00000054 __TEXT:__literal8:0x00000000 0x40200000
+# CHECK: 00000058 __TEXT:__literal16:0x10000016 0x20000016 0x30000016 0x40000016
+# CHECK: 0000005c 0x30 (not in a literal section)
diff --git a/test/tools/llvm-objdump/X86/macho-literal-pointers-x86_64.test b/test/tools/llvm-objdump/X86/macho-literal-pointers-x86_64.test
new file mode 100644
index 0000000..b403b81
--- /dev/null
+++ b/test/tools/llvm-objdump/X86/macho-literal-pointers-x86_64.test
@@ -0,0 +1,34 @@
+# RUN: llvm-mc < %s -triple x86_64-apple-darwin -filetype=obj | llvm-objdump -m -section __DATA,__litp - | FileCheck %s
+
+.cstring
+L1: .asciz "Hello world\n"
+
+.literal4
+.align 2
+L2: .float 4.0
+
+.literal8
+.align 3
+L3: .double 8.0
+
+.literal16
+.align 4
+L4: .long 0x10000016, 0x20000016, 0x30000016, 0x40000016
+
+.const
+L5: .asciz "const non-literal string"
+
+.section __DATA,__litp, literal_pointers
+.align 3
+.quad L1
+.quad L2
+.quad L3
+.quad L4
+.quad L5
+
+# CHECK: Contents of (__DATA,__litp) section
+# CHECK: 0000000000000050 __TEXT:__cstring:Hello world\n
+# CHECK: 0000000000000058 __TEXT:__literal4:0x40800000
+# CHECK: 0000000000000060 __TEXT:__literal8:0x00000000 0x40200000
+# CHECK: 0000000000000068 __TEXT:__literal16:0x10000016 0x20000016 0x30000016 0x40000016
+# CHECK: 0000000000000070 0x30 (not in a literal section)
diff --git a/test/tools/llvm-objdump/X86/macho-literals.test b/test/tools/llvm-objdump/X86/macho-literals.test
new file mode 100644
index 0000000..4824453
--- /dev/null
+++ b/test/tools/llvm-objdump/X86/macho-literals.test
@@ -0,0 +1,48 @@
+# RUN: llvm-mc < %s -triple x86_64-apple-darwin -filetype=obj | llvm-objdump -m -section __TEXT,__literal4 - | FileCheck %s -check-prefix=CHECK-LIT4
+# RUN: llvm-mc < %s -triple x86_64-apple-darwin -filetype=obj | llvm-objdump -m -section __TEXT,__literal8 - | FileCheck %s -check-prefix=CHECK-LIT8
+# RUN: llvm-mc < %s -triple x86_64-apple-darwin -filetype=obj | llvm-objdump -m -section __TEXT,__literal16 - | FileCheck %s -check-prefix=CHECK-LIT16
+
+.literal4
+.float 2.5
+.float 8.25
+.long 0x7f800000
+.long 0xff800000
+.long 0x7fc00000
+.long 0x7f800001
+
+# CHECK-LIT4: Contents of (__TEXT,__literal4) section
+# CHECK-LIT4: 0000000000000000 0x40200000
+# CHECK-LIT4: 0000000000000004 0x41040000
+# CHECK-LIT4: 0000000000000008 0x7f800000
+# CHECK-LIT4: 000000000000000c 0xff800000
+# CHECK-LIT4: 0000000000000010 0x7fc00000
+# CHECK-LIT4: 0000000000000014 0x7f800001
+
+.literal8
+.double 2.5
+.double 8.25
+.long 0
+.long 0x7ff00000
+.long 0
+.long 0xfff00000
+.long 0
+.long 0x7ff80000
+.long 1
+.long 0x7ff00000
+
+# CHECK-LIT8: Contents of (__TEXT,__literal8) section
+# CHECK-LIT8: 0000000000000018 0x00000000 0x40040000
+# CHECK-LIT8: 0000000000000020 0x00000000 0x40208000
+# CHECK-LIT8: 0000000000000028 0x00000000 0x7ff00000
+# CHECK-LIT8: 0000000000000030 0x00000000 0xfff00000
+# CHECK-LIT8: 0000000000000038 0x00000000 0x7ff80000
+# CHECK-LIT8: 0000000000000040 0x00000001 0x7ff00000
+
+.literal16
+.long 1
+.long 2
+.long 3
+.long 4
+
+# CHECK-LIT16: Contents of (__TEXT,__literal16) section
+# CHECK-LIT16: 0000000000000050 0x00000001 0x00000002 0x00000003 0x00000004
diff --git a/test/tools/llvm-objdump/X86/macho-nontext-disasm.test b/test/tools/llvm-objdump/X86/macho-nontext-disasm.test
new file mode 100644
index 0000000..27b7bb4
--- /dev/null
+++ b/test/tools/llvm-objdump/X86/macho-nontext-disasm.test
@@ -0,0 +1,9 @@
+# RUN: llvm-mc < %s -triple x86_64-apple-darwin -filetype=obj | llvm-objdump -m -section __FOO,__bar -full-leading-addr -print-imm-hex -no-show-raw-insn - | FileCheck %s
+
+.section __FOO, __bar
+_foo:
+ nop
+
+# CHECK: Contents of (__FOO,__bar) section
+# CHECK: _foo:
+# CHECK: 0000000000000000 nop
diff --git a/test/tools/llvm-objdump/X86/macho-private-headers.test b/test/tools/llvm-objdump/X86/macho-private-headers.test
index 685b4f7..c80bb08 100644
--- a/test/tools/llvm-objdump/X86/macho-private-headers.test
+++ b/test/tools/llvm-objdump/X86/macho-private-headers.test
@@ -3,6 +3,22 @@
// RUN: | FileCheck %s -check-prefix=EXE
// RUN: llvm-objdump -p %p/Inputs/dylibLoadKinds.macho-x86_64 \
// RUN: | FileCheck %s -check-prefix=LOAD
+// RUN: llvm-objdump -p %p/Inputs/linkerOption.macho-x86_64 \
+// RUN: | FileCheck %s -check-prefix=LD_OPT
+// RUN: llvm-objdump -p %p/Inputs/dylibSubFramework.macho-x86_64 \
+// RUN: | FileCheck %s -check-prefix=SUB_FRAME
+// RUN: llvm-objdump -p %p/Inputs/dylibSubUmbrella.macho-x86_64 \
+// RUN: | FileCheck %s -check-prefix=SUB_UMB
+// RUN: llvm-objdump -p %p/Inputs/dylibSubLibrary.macho-x86_64 \
+// RUN: | FileCheck %s -check-prefix=SUB_LIB
+// RUN: llvm-objdump -p %p/Inputs/dylibSubClient.macho-x86_64 \
+// RUN: | FileCheck %s -check-prefix=SUB_CLI
+// RUN: llvm-objdump -p %p/Inputs/dylibRoutines.macho-x86_64 \
+// RUN: | FileCheck %s -check-prefix=ROUTINE
+// RUN: llvm-objdump -p %p/Inputs/exeThread.macho-x86_64 \
+// RUN: | FileCheck %s -check-prefix=THREAD
+// RUN: llvm-objdump -macho -p -arch i386 %p/Inputs/macho-universal.x86_64.i386 \
+// RUN: | FileCheck %s -check-prefix=FATi386
CHECK: Mach header
CHECK: magic cputype cpusubtype caps filetype ncmds sizeofcmds flags
@@ -366,3 +382,64 @@ LOAD: name /usr/lib/foo4.dylib (offset 24)
LOAD: current version 0.0.0
LOAD: compatibility version 0.0.0
+LD_OPT: Load command 4
+LD_OPT: cmd LC_LINKER_OPTION
+LD_OPT: cmdsize 24
+LD_OPT: count 1
+LD_OPT: string #1 -lc++
+LD_OPT: Load command 5
+LD_OPT: cmd LC_LINKER_OPTION
+LD_OPT: cmdsize 40
+LD_OPT: count 2
+LD_OPT: string #1 -framework
+LD_OPT: string #2 Foundation
+
+SUB_FRAME: Load command 10
+SUB_FRAME: cmd LC_SUB_FRAMEWORK
+SUB_FRAME: cmdsize 16
+SUB_FRAME: umbrella Bar (offset 12)
+
+SUB_UMB: Load command 5
+SUB_UMB: cmd LC_SUB_UMBRELLA
+SUB_UMB: cmdsize 16
+SUB_UMB: sub_umbrella Foo (offset 12)
+
+SUB_LIB: Load command 5
+SUB_LIB: cmd LC_SUB_LIBRARY
+SUB_LIB: cmdsize 20
+SUB_LIB: sub_library libfoo (offset 12)
+
+SUB_CLI: Load command 10
+SUB_CLI: cmd LC_SUB_CLIENT
+SUB_CLI: cmdsize 16
+SUB_CLI: client bar (offset 12)
+
+ROUTINE: Load command 6
+ROUTINE: cmd LC_ROUTINES_64
+ROUTINE: cmdsize 72
+ROUTINE: init_address 0x0000000000000f80
+ROUTINE: init_module 0
+ROUTINE: reserved1 0
+ROUTINE: reserved2 0
+ROUTINE: reserved3 0
+ROUTINE: reserved4 0
+ROUTINE: reserved5 0
+ROUTINE: reserved6 0
+
+THREAD: Load command 10
+THREAD: cmd LC_UNIXTHREAD
+THREAD: cmdsize 184
+THREAD: flavor x86_THREAD_STATE64
+THREAD: count x86_THREAD_STATE64_COUNT
+THREAD: rax 0x0000000000000000 rbx 0x0000000000000000 rcx 0x0000000000000000
+THREAD: rdx 0x0000000000000000 rdi 0x0000000000000000 rsi 0x0000000000000000
+THREAD: rbp 0x0000000000000000 rsp 0x0000000000000000 r8 0x0000000000000000
+THREAD: r9 0x0000000000000000 r10 0x0000000000000000 r11 0x0000000000000000
+THREAD: r12 0x0000000000000000 r13 0x0000000000000000 r14 0x0000000000000000
+THREAD: r15 0x0000000000000000 rip 0x0000000100000d00
+THREAD: rflags 0x0000000000000000 cs 0x0000000000000000 fs 0x0000000000000000
+THREAD: gs 0x0000000000000000
+
+FATi386: Mach header
+FATi386: magic cputype cpusubtype caps filetype ncmds sizeofcmds flags
+FATi386: MH_MAGIC I386 ALL 0x00 EXECUTE 16 716 NOUNDEFS DYLDLINK TWOLEVEL PIE MH_NO_HEAP_EXECUTION
diff --git a/test/tools/llvm-objdump/X86/macho-relocations.test b/test/tools/llvm-objdump/X86/macho-relocations.test
new file mode 100644
index 0000000..536aec8
--- /dev/null
+++ b/test/tools/llvm-objdump/X86/macho-relocations.test
@@ -0,0 +1,7 @@
+RUN: llvm-objdump -macho -r %p/Inputs/hello.obj.macho-x86_64 | FileCheck %s
+
+CHECK: RELOCATION RECORDS FOR [__text]:
+CHECK: 0000000000000027 X86_64_RELOC_BRANCH _printf
+CHECK: 000000000000000b X86_64_RELOC_SIGNED L_.str
+CHECK: RELOCATION RECORDS FOR [__compact_unwind]:
+CHECK: 0000000000000000 X86_64_RELOC_UNSIGNED __text
diff --git a/test/tools/llvm-objdump/X86/macho-section-contents.test b/test/tools/llvm-objdump/X86/macho-section-contents.test
new file mode 100644
index 0000000..f62b5a7
--- /dev/null
+++ b/test/tools/llvm-objdump/X86/macho-section-contents.test
@@ -0,0 +1,17 @@
+RUN: llvm-objdump -macho -s %p/Inputs/hello.obj.macho-x86_64 | FileCheck %s
+
+CHECK: Contents of section __text:
+CHECK: 0000 554889e5 4883ec20 488d0500 000000c7 UH..H.. H.......
+CHECK: 0010 45fc0000 0000897d f8488975 f0488955 E......}.H.u.H.U
+CHECK: 0020 e84889c7 b000e800 000000b9 00000000 .H..............
+CHECK: 0030 8945e489 c84883c4 205dc3 .E...H.. ].
+CHECK: Contents of section __cstring:
+CHECK: 003b 48656c6c 6f20776f 726c640a 00 Hello world..
+CHECK: Contents of section __compact_unwind:
+CHECK: 0048 00000000 00000000 3b000000 00000001 ........;.......
+CHECK: 0058 00000000 00000000 00000000 00000000 ................
+CHECK: Contents of section __eh_frame:
+CHECK: 0068 14000000 00000000 017a5200 01781001 .........zR..x..
+CHECK: 0078 100c0708 90010000 24000000 1c000000 ........$.......
+CHECK: 0088 78ffffff ffffffff 3b000000 00000000 x.......;.......
+CHECK: 0098 00410e10 8602430d 06000000 00000000 .A....C.........
diff --git a/test/tools/llvm-objdump/X86/macho-section-headers.test b/test/tools/llvm-objdump/X86/macho-section-headers.test
new file mode 100644
index 0000000..5159d18
--- /dev/null
+++ b/test/tools/llvm-objdump/X86/macho-section-headers.test
@@ -0,0 +1,8 @@
+RUN: llvm-objdump -macho -h %p/Inputs/hello.obj.macho-x86_64 | FileCheck %s
+
+CHECK: Sections:
+CHECK: Idx Name Size Address Type
+CHECK: 0 __text 0000003b 0000000000000000 TEXT
+CHECK: 1 __cstring 0000000d 000000000000003b DATA
+CHECK: 2 __compact_unwind 00000020 0000000000000048 DATA
+CHECK: 3 __eh_frame 00000040 0000000000000068 DATA
diff --git a/test/tools/llvm-objdump/X86/macho-section.test b/test/tools/llvm-objdump/X86/macho-section.test
new file mode 100644
index 0000000..720b9a4
--- /dev/null
+++ b/test/tools/llvm-objdump/X86/macho-section.test
@@ -0,0 +1,4 @@
+// RUN: llvm-objdump -m -section __DATA,__mod_init_func %p/Inputs/dylibModInit.macho-x86_64 | FileCheck %s -check-prefix=MODINIT
+
+MODINIT: Contents of (__DATA,__mod_init_func) section
+MODINIT: 0x0000000000001000 0x0000000000000f30 _libinit
diff --git a/test/tools/llvm-objdump/X86/macho-symbol-table.test b/test/tools/llvm-objdump/X86/macho-symbol-table.test
new file mode 100644
index 0000000..5b9a4f8
--- /dev/null
+++ b/test/tools/llvm-objdump/X86/macho-symbol-table.test
@@ -0,0 +1,8 @@
+RUN: llvm-objdump -macho -t %p/Inputs/hello.obj.macho-x86_64 | FileCheck %s
+
+CHECK: SYMBOL TABLE:
+CHECK: 000000000000003b l F __TEXT,__cstring 0000000d L_.str
+CHECK: 0000000000000068 l F __TEXT,__eh_frame 00000018 EH_frame0
+CHECK: 0000000000000000 g F __TEXT,__text 0000003b _main
+CHECK: 0000000000000080 g F __TEXT,__eh_frame 00000028 _main.eh
+CHECK: 0000000000000000 *UND* 00000000 _printf
diff --git a/test/tools/llvm-objdump/X86/macho-universal-x86_64.i386.test b/test/tools/llvm-objdump/X86/macho-universal-x86_64.i386.test
new file mode 100644
index 0000000..e4fd37a
--- /dev/null
+++ b/test/tools/llvm-objdump/X86/macho-universal-x86_64.i386.test
@@ -0,0 +1,44 @@
+RUN: llvm-objdump %p/Inputs/macho-universal.x86_64.i386 -d -m -no-show-raw-insn -full-leading-addr -print-imm-hex -arch all \
+RUN: | FileCheck %s -check-prefix UEXE-all
+RUN: llvm-objdump %p/Inputs/macho-universal-archive.x86_64.i386 -d -m -no-show-raw-insn -full-leading-addr -print-imm-hex -arch i386 \
+RUN: | FileCheck %s -check-prefix UArchive-i386
+RUN: llvm-objdump %p/Inputs/macho-universal.x86_64.i386 -universal-headers -m \
+RUN: | FileCheck %s -check-prefix FAT
+
+UEXE-all: macho-universal.x86_64.i386 (architecture x86_64):
+UEXE-all: (__TEXT,__text) section
+UEXE-all: _main:
+UEXE-all: 0000000100000f60 pushq %rbp
+UEXE-all: 0000000100000f61 movq %rsp, %rbp
+UEXE-all: macho-universal.x86_64.i386 (architecture i386):
+UEXE-all: (__TEXT,__text) section
+UEXE-all: _main:
+UEXE-all: 00001fa0 pushl %ebp
+UEXE-all: 00001fa1 movl %esp, %ebp
+
+UArchive-i386: Archive : {{.*}}/macho-universal-archive.x86_64.i386
+UArchive-i386: macho-universal-archive.x86_64.i386(foo.o):
+UArchive-i386: (__TEXT,__text) section
+UArchive-i386: _foo:
+UArchive-i386: 00000000 pushl %ebp
+UArchive-i386: 00000001 movl %esp, %ebp
+UArchive-i386: 00000003 popl %ebp
+UArchive-i386: 00000004 retl
+
+FAT: Fat headers
+FAT: fat_magic FAT_MAGIC
+FAT: nfat_arch 2
+FAT: architecture x86_64
+FAT: cputype CPU_TYPE_X86_64
+FAT: cpusubtype CPU_SUBTYPE_X86_64_ALL
+FAT: capabilities CPU_SUBTYPE_LIB64
+FAT: offset 4096
+FAT: size 4360
+FAT: align 2^12 (4096)
+FAT: architecture i386
+FAT: cputype CPU_TYPE_I386
+FAT: cpusubtype CPU_SUBTYPE_I386_ALL
+FAT: capabilities 0x0
+FAT: offset 12288
+FAT: size 4336
+FAT: align 2^12 (4096)
diff --git a/test/tools/llvm-objdump/X86/macho-unwind-info.test b/test/tools/llvm-objdump/X86/macho-unwind-info.test
new file mode 100644
index 0000000..33db84f
--- /dev/null
+++ b/test/tools/llvm-objdump/X86/macho-unwind-info.test
@@ -0,0 +1,7 @@
+RUN: llvm-objdump -macho -u %p/Inputs/hello.obj.macho-x86_64 | FileCheck %s
+
+CHECK: Contents of __compact_unwind section:
+CHECK: Entry at offset 0x0:
+CHECK: start: 0x0 _main
+CHECK: length: 0x3b
+CHECK: compact encoding: 0x01000000