aboutsummaryrefslogtreecommitdiffstats
path: root/test/tools
diff options
context:
space:
mode:
authorPirama Arumuga Nainar <pirama@google.com>2015-04-08 08:55:49 -0700
committerPirama Arumuga Nainar <pirama@google.com>2015-04-09 15:04:38 -0700
commit4c5e43da7792f75567b693105cc53e3f1992ad98 (patch)
tree1b2c9792582e12f5af0b1512e3094425f0dc0df9 /test/tools
parentc75239e6119d0f9a74c57099d91cbc9bde56bf33 (diff)
downloadexternal_llvm-4c5e43da7792f75567b693105cc53e3f1992ad98.zip
external_llvm-4c5e43da7792f75567b693105cc53e3f1992ad98.tar.gz
external_llvm-4c5e43da7792f75567b693105cc53e3f1992ad98.tar.bz2
Update aosp/master llvm for rebase to r233350
Change-Id: I07d935f8793ee8ec6b7da003f6483046594bca49
Diffstat (limited to 'test/tools')
-rwxr-xr-xtest/tools/dsymutil/Inputs/basic-lto-dw4.macho.x86_64bin0 -> 8920 bytes
-rw-r--r--test/tools/dsymutil/Inputs/basic-lto-dw4.macho.x86_64.obin0 -> 3800 bytes
-rw-r--r--test/tools/dsymutil/X86/basic-linking-x86.test218
-rw-r--r--test/tools/dsymutil/X86/basic-lto-dw4-linking-x86.test204
-rw-r--r--test/tools/dsymutil/X86/basic-lto-linking-x86.test207
-rw-r--r--test/tools/dsymutil/X86/lit.local.cfg2
-rw-r--r--test/tools/dsymutil/basic-linking.test6
-rw-r--r--test/tools/dsymutil/debug-map-parsing.test44
-rw-r--r--test/tools/gold/mtriple.ll2
-rw-r--r--test/tools/gold/opt-level.ll50
-rw-r--r--test/tools/gold/option.ll39
-rw-r--r--test/tools/gold/pr19901.ll3
-rw-r--r--test/tools/gold/remarks.ll22
-rw-r--r--test/tools/gold/slp-vectorize.ll14
-rw-r--r--test/tools/gold/vectorize.ll6
-rwxr-xr-xtest/tools/llvm-cov/Inputs/binary-formats.macho32bbin0 -> 9352 bytes
-rwxr-xr-xtest/tools/llvm-cov/Inputs/binary-formats.macho32lbin0 -> 812 bytes
-rwxr-xr-xtest/tools/llvm-cov/Inputs/binary-formats.macho64lbin0 -> 920 bytes
-rw-r--r--test/tools/llvm-cov/Inputs/binary-formats.proftext4
-rw-r--r--test/tools/llvm-cov/Inputs/lineExecutionCounts.profdatabin656 -> 0 bytes
-rw-r--r--test/tools/llvm-cov/Inputs/lineExecutionCounts.proftext8
-rw-r--r--test/tools/llvm-cov/Inputs/regionMarkers.profdatabin656 -> 0 bytes
-rw-r--r--test/tools/llvm-cov/Inputs/regionMarkers.proftext8
-rw-r--r--test/tools/llvm-cov/Inputs/test_exit_block_arcs.gcdabin0 -> 124 bytes
-rw-r--r--test/tools/llvm-cov/Inputs/test_exit_block_arcs.gcnobin0 -> 216 bytes
-rwxr-xr-xtest/tools/llvm-cov/Inputs/universal-binarybin0 -> 960 bytes
-rw-r--r--test/tools/llvm-cov/Inputs/universal-binary.proftext4
-rw-r--r--test/tools/llvm-cov/binary-formats.c9
-rw-r--r--test/tools/llvm-cov/copy_block_helper.m2
-rw-r--r--test/tools/llvm-cov/lit.local.cfg6
-rw-r--r--test/tools/llvm-cov/llvm-cov.test47
-rw-r--r--test/tools/llvm-cov/range_based_for.cpp2
-rw-r--r--test/tools/llvm-cov/report.cpp7
-rw-r--r--test/tools/llvm-cov/showExpansions.cpp3
-rw-r--r--test/tools/llvm-cov/showHighlightedRanges.cpp3
-rw-r--r--test/tools/llvm-cov/showLineExecutionCounts.cpp8
-rw-r--r--test/tools/llvm-cov/showRegionMarkers.cpp5
-rw-r--r--test/tools/llvm-cov/showTemplateInstantiations.cpp7
-rw-r--r--test/tools/llvm-cov/universal-binary.c10
-rw-r--r--test/tools/llvm-cxxdump/Inputs/eh.obj.coff-i386bin0 -> 7388 bytes
-rw-r--r--test/tools/llvm-cxxdump/Inputs/trivial.obj.coff-i386 (renamed from test/tools/llvm-vtabledump/Inputs/trivial.obj.coff-i386)bin2938 -> 2938 bytes
-rw-r--r--test/tools/llvm-cxxdump/Inputs/trivial.obj.elf-i386 (renamed from test/tools/llvm-vtabledump/Inputs/trivial.obj.elf-i386)bin1032 -> 1032 bytes
-rw-r--r--test/tools/llvm-cxxdump/eh.test258
-rw-r--r--test/tools/llvm-cxxdump/trivial.test (renamed from test/tools/llvm-vtabledump/trivial.test)4
-rw-r--r--test/tools/llvm-objdump/ARM/macho-data-in-code.test8
-rw-r--r--test/tools/llvm-objdump/X86/macho-cstring-dump.test9
-rw-r--r--test/tools/llvm-objdump/X86/macho-dis-no-leading-addr.test24
-rw-r--r--test/tools/llvm-objdump/X86/macho-dis-symname.test19
-rw-r--r--test/tools/llvm-objdump/X86/macho-dylib.test6
-rw-r--r--test/tools/llvm-objdump/X86/macho-indirect-symbols.test12
-rw-r--r--test/tools/llvm-objdump/X86/macho-info-plist.test7
-rw-r--r--test/tools/llvm-objdump/X86/macho-literal-pointers-i386.test5
-rw-r--r--test/tools/llvm-objdump/X86/macho-literal-pointers-x86_64.test6
-rw-r--r--test/tools/llvm-objdump/X86/macho-literals.test15
-rw-r--r--test/tools/llvm-objdump/X86/macho-private-headers.test94
-rw-r--r--test/tools/llvm-objdump/X86/macho-section.test4
-rw-r--r--test/tools/llvm-objdump/X86/macho-symbolized-disassembly.test9
-rw-r--r--test/tools/llvm-objdump/X86/macho-universal-x86_64.i386.test20
-rw-r--r--test/tools/llvm-pdbdump/Inputs/ClassLayoutTest.cpp64
-rw-r--r--test/tools/llvm-pdbdump/Inputs/ClassLayoutTest.pdbbin0 -> 35840 bytes
-rw-r--r--test/tools/llvm-pdbdump/Inputs/FilterTest.cpp29
-rw-r--r--test/tools/llvm-pdbdump/Inputs/FilterTest.pdbbin0 -> 44032 bytes
-rw-r--r--test/tools/llvm-pdbdump/class-layout.test57
-rw-r--r--test/tools/llvm-pdbdump/enum-layout.test20
-rw-r--r--test/tools/llvm-pdbdump/lit.local.cfg1
-rw-r--r--test/tools/llvm-pdbdump/regex-filter.test75
-rw-r--r--test/tools/llvm-profdata/general.proftext12
-rw-r--r--test/tools/llvm-readobj/Inputs/macho-universal.x86_64.i386bin0 -> 16624 bytes
-rw-r--r--test/tools/llvm-readobj/Inputs/trivial.ll2
-rw-r--r--test/tools/llvm-readobj/macho-universal-x86_64.i386.test141
-rw-r--r--test/tools/lto/lit.local.cfg2
-rw-r--r--test/tools/lto/opt-level.ll20
72 files changed, 1742 insertions, 131 deletions
diff --git a/test/tools/dsymutil/Inputs/basic-lto-dw4.macho.x86_64 b/test/tools/dsymutil/Inputs/basic-lto-dw4.macho.x86_64
new file mode 100755
index 0000000..7e7ba2f
--- /dev/null
+++ b/test/tools/dsymutil/Inputs/basic-lto-dw4.macho.x86_64
Binary files differ
diff --git a/test/tools/dsymutil/Inputs/basic-lto-dw4.macho.x86_64.o b/test/tools/dsymutil/Inputs/basic-lto-dw4.macho.x86_64.o
new file mode 100644
index 0000000..307a681
--- /dev/null
+++ b/test/tools/dsymutil/Inputs/basic-lto-dw4.macho.x86_64.o
Binary files differ
diff --git a/test/tools/dsymutil/X86/basic-linking-x86.test b/test/tools/dsymutil/X86/basic-linking-x86.test
new file mode 100644
index 0000000..1059e23
--- /dev/null
+++ b/test/tools/dsymutil/X86/basic-linking-x86.test
@@ -0,0 +1,218 @@
+REQUIRES: shell
+RUN: cat %p/../Inputs/basic.macho.x86_64 > %t1
+RUN: llvm-dsymutil -oso-prepend-path=%p/.. %t1
+RUN: llvm-dwarfdump %t1.dwarf | FileCheck %s
+RUN: llvm-dsymutil -o %t2 -oso-prepend-path=%p/.. %p/../Inputs/basic.macho.x86_64
+RUN: llvm-dwarfdump %t2 | FileCheck %s
+RUN: llvm-dsymutil -o - -oso-prepend-path=%p/.. %p/../Inputs/basic.macho.x86_64 | llvm-dwarfdump - | FileCheck %s --check-prefix=CHECK --check-prefix=BASIC
+RUN: llvm-dsymutil -o - -oso-prepend-path=%p/.. %p/../Inputs/basic-archive.macho.x86_64 | llvm-dwarfdump - | FileCheck %s --check-prefix=CHECK --check-prefix=ARCHIVE
+
+CHECK: file format Mach-O 64-bit x86-64
+
+CHECK: debug_info contents
+
+CHECK: Compile Unit:
+
+CHECK: DW_TAG_compile_unit [1] *
+CHECK: DW_AT_producer [DW_FORM_strp] ( .debug_str[0x00000001] = "Apple LLVM version 6.0 (clang-600.0.39) (based on LLVM 3.5svn)")
+CHECK: DW_AT_language [DW_FORM_data2] (DW_LANG_C99)
+CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000040] = "basic1.c")
+CHECK: DW_AT_stmt_list [DW_FORM_data4] (0x00000000)
+CHECK: DW_AT_comp_dir [DW_FORM_strp] ( .debug_str[0x00000049] = "/Inputs")
+CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000ea0)
+CHECK: DW_TAG_subprogram [2] *
+CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000051] = "main")
+CHECK: DW_AT_decl_file [DW_FORM_data1] ("/Inputs{{[/\\]}}basic1.c")
+CHECK: DW_AT_decl_line [DW_FORM_data1] (23)
+CHECK: DW_AT_prototyped [DW_FORM_flag] (0x01)
+CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0063 => {0x00000063})
+CHECK: DW_AT_external [DW_FORM_flag] (0x01)
+CHECK: DW_AT_accessibility [DW_FORM_data1] (DW_ACCESS_public)
+CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000ea0)
+CHECK: DW_AT_high_pc [DW_FORM_addr] (0x0000000100000ec4)
+CHECK: DW_AT_frame_base [DW_FORM_block1] (<0x01> 56 )
+CHECK: DW_TAG_formal_parameter [3]
+CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000056] = "argc")
+CHECK: DW_AT_decl_file [DW_FORM_data1] ("/Inputs{{[/\\]}}basic1.c")
+CHECK: DW_AT_decl_line [DW_FORM_data1] (23)
+CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0063 => {0x00000063})
+CHECK: DW_AT_location [DW_FORM_block1] (<0x02> 91 78 )
+CHECK: DW_TAG_formal_parameter [3]
+CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000005b] = "argv")
+CHECK: DW_AT_decl_file [DW_FORM_data1] ("/Inputs{{[/\\]}}basic1.c")
+CHECK: DW_AT_decl_line [DW_FORM_data1] (23)
+CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x006a => {0x0000006a})
+CHECK: DW_AT_location [DW_FORM_block1] (<0x02> 91 70 )
+CHECK: NULL
+CHECK: DW_TAG_base_type [4]
+CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000060] = "int")
+CHECK: DW_AT_encoding [DW_FORM_data1] (DW_ATE_signed)
+CHECK: DW_AT_byte_size [DW_FORM_data1] (0x04)
+CHECK: DW_TAG_pointer_type [5]
+CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x006f => {0x0000006f})
+CHECK: DW_TAG_pointer_type [5]
+CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0074 => {0x00000074})
+CHECK: DW_TAG_const_type [6]
+CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0079 => {0x00000079})
+CHECK: DW_TAG_base_type [4]
+CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000064] = "char")
+CHECK: DW_AT_encoding [DW_FORM_data1] (DW_ATE_signed_char)
+CHECK: DW_AT_byte_size [DW_FORM_data1] (0x01)
+CHECK: NULL
+
+CHECK: Compile Unit:
+
+CHECK: DW_TAG_compile_unit [1] *
+CHECK: DW_AT_producer [DW_FORM_strp] ( .debug_str[0x00000001] = "Apple LLVM version 6.0 (clang-600.0.39) (based on LLVM 3.5svn)")
+CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000069] = "basic2.c")
+CHECK: DW_AT_stmt_list [DW_FORM_data4] (0x0000003f)
+CHECK: DW_AT_comp_dir [DW_FORM_strp] ( .debug_str[0x00000049] = "/Inputs")
+CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000ed0)
+CHECK: DW_TAG_base_type [4]
+CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000060] = "int")
+CHECK: DW_TAG_variable [7]
+CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000072] = "private_int")
+CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0026 => {0x000000a7})
+CHECK: DW_AT_decl_file [DW_FORM_data1] ("/Inputs{{[/\\]}}basic2.c")
+BASIC: DW_AT_location [DW_FORM_block1] (<0x09> 03 08 10 00 00 01 00 00 00 )
+ARCHIVE: DW_AT_location [DW_FORM_block1] (<0x09> 03 04 10 00 00 01 00 00 00 )
+CHECK: DW_TAG_variable [7]
+CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000007e] = "baz")
+CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0026 => {0x000000a7})
+CHECK: DW_AT_decl_file [DW_FORM_data1] ("/Inputs{{[/\\]}}basic2.c")
+CHECK: DW_AT_location [DW_FORM_block1] (<0x09> 03 00 10 00 00 01 00 00 00 )
+CHECK: DW_TAG_subprogram [2] *
+CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000082] = "foo")
+CHECK: DW_AT_decl_file [DW_FORM_data1] ("/Inputs{{[/\\]}}basic2.c")
+CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0026 => {0x000000a7})
+CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000ed0)
+CHECK: DW_AT_high_pc [DW_FORM_addr] (0x0000000100000f19)
+CHECK: DW_AT_frame_base [DW_FORM_block1] (<0x01> 56 )
+CHECK: DW_TAG_formal_parameter [3]
+CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000086] = "arg")
+CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0026 => {0x000000a7})
+CHECK: DW_AT_location [DW_FORM_block1] (<0x02> 91 7c )
+CHECK: NULL
+CHECK: DW_TAG_subprogram [8]
+CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000008a] = "inc")
+CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0026 => {0x000000a7})
+CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000f20)
+CHECK: DW_AT_high_pc [DW_FORM_addr] (0x0000000100000f37)
+CHECK: DW_AT_frame_base [DW_FORM_block1] (<0x01> 56 )
+CHECK: NULL
+
+CHECK: Compile Unit:
+
+CHECK: DW_TAG_compile_unit [1] *
+CHECK: DW_AT_producer [DW_FORM_strp] ( .debug_str[0x00000001] = "Apple LLVM version 6.0 (clang-600.0.39) (based on LLVM 3.5svn)")
+CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000008e] = "basic3.c")
+CHECK: DW_AT_stmt_list [DW_FORM_data4] (0x00000093)
+CHECK: DW_AT_comp_dir [DW_FORM_strp] ( .debug_str[0x00000049] = "/Inputs")
+CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000f40)
+CHECK: DW_TAG_variable [9]
+CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000097] = "val")
+CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x003c => {0x00000162})
+CHECK: DW_AT_decl_file [DW_FORM_data1] ("/Inputs{{[/\\]}}basic3.c")
+BASIC: DW_AT_location [DW_FORM_block1] (<0x09> 03 04 10 00 00 01 00 00 00 )
+ARCHIVE: DW_AT_location [DW_FORM_block1] (<0x09> 03 08 10 00 00 01 00 00 00 )
+CHECK: DW_TAG_volatile_type [10]
+CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0041 => {0x00000167})
+CHECK: DW_TAG_base_type [4]
+CHACK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000060] = "int")
+CHECK: DW_TAG_subprogram [2] *
+CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000009b] = "bar")
+CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0041 => {0x00000167})
+CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000f40)
+CHECK: DW_AT_high_pc [DW_FORM_addr] (0x0000000100000f84)
+CHECK: DW_AT_frame_base [DW_FORM_block1] (<0x01> 56 )
+CHECK: DW_TAG_formal_parameter [3]
+CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000086] = "arg")
+CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0041 => {0x00000167})
+CHECK: DW_AT_location [DW_FORM_block1] (<0x02> 91 78 )
+CHECK: NULL
+CHECK: DW_TAG_subprogram [8]
+CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000008a] = "inc")
+CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0041 => {0x00000167})
+CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000f90)
+CHECK: DW_AT_high_pc [DW_FORM_addr] (0x0000000100000fa9)
+CHECK: DW_AT_frame_base [DW_FORM_block1] (<0x01> 56 )
+
+CHECK: NULL
+
+CHECK: .debug_loc contents
+CHECK-NOT: Location
+
+CHECK:.debug_aranges contents:
+CHECK-NEXT:Address Range Header: length = 0x0000002c, version = 0x0002, cu_offset = 0x00000000, addr_size = 0x08, seg_size = 0x00
+CHECK-NEXT:[0x0000000100000ea0 - 0x0000000100000ec4)
+CHECK-NEXT:Address Range Header: length = 0x0000003c, version = 0x0002, cu_offset = 0x00000081, addr_size = 0x08, seg_size = 0x00
+CHECK-NEXT:[0x0000000100000ed0 - 0x0000000100000f19)
+CHECK-NEXT:[0x0000000100000f20 - 0x0000000100000f37)
+CHECK-NEXT:Address Range Header: length = 0x0000003c, version = 0x0002, cu_offset = 0x00000126, addr_size = 0x08, seg_size = 0x00
+CHECK-NEXT:[0x0000000100000f40 - 0x0000000100000f84)
+CHECK-NEXT:[0x0000000100000f90 - 0x0000000100000fa9)
+
+CHECK: .debug_line contents:
+CHECK: Dir Mod Time File Len File Name
+CHECK-NEXT: ---- ---------- ---------- ---------------------------
+CHECK-NEXT: file_names[ 1] 0 0x00000000 0x00000000 basic1.c
+CHECK: Address Line Column File ISA Discriminator Flags
+CHECK-NEXT: ------------------ ------ ------ ------ --- ------------- -------------
+CHECK-NEXT: 0x0000000100000ea0 23 0 1 0 0 is_stmt
+CHECK-NEXT: 0x0000000100000eb6 24 0 1 0 0 is_stmt prologue_end
+CHECK-NEXT: 0x0000000100000ec4 24 0 1 0 0 is_stmt end_sequence
+
+CHECK: Dir Mod Time File Len File Name
+CHECK-NEXT: ---- ---------- ---------- ---------------------------
+CHECK-NEXT: file_names[ 1] 0 0x00000000 0x00000000 basic2.c
+CHECK: Address Line Column File ISA Discriminator Flags
+CHECK-NEXT: ------------------ ------ ------ ------ --- ------------- -------------
+CHECK-NEXT: 0x0000000100000ed0 19 0 1 0 0 is_stmt
+CHECK-NEXT: 0x0000000100000ee2 20 0 1 0 0 is_stmt prologue_end
+CHECK-NEXT: 0x0000000100000f19 20 0 1 0 0 is_stmt end_sequence
+CHECK-NEXT: 0x0000000100000f20 14 0 1 0 0 is_stmt
+CHECK-NEXT: 0x0000000100000f24 15 0 1 0 0 is_stmt prologue_end
+CHECK-NEXT: 0x0000000100000f37 15 0 1 0 0 is_stmt end_sequence
+
+CHECK: Dir Mod Time File Len File Name
+CHECK-NEXT: ---- ---------- ---------- ---------------------------
+CHECK-NEXT: file_names[ 1] 0 0x00000000 0x00000000 basic3.c
+CHECK: Address Line Column File ISA Discriminator Flags
+CHECK-NEXT: ------------------ ------ ------ ------ --- ------------- -------------
+CHECK-NEXT: 0x0000000100000f40 16 0 1 0 0 is_stmt
+CHECK-NEXT: 0x0000000100000f4b 17 0 1 0 0 is_stmt prologue_end
+CHECK-NEXT: 0x0000000100000f58 18 0 1 0 0 is_stmt
+CHECK-NEXT: 0x0000000100000f6c 19 0 1 0 0 is_stmt
+CHECK-NEXT: 0x0000000100000f7b 20 0 1 0 0 is_stmt
+CHECK-NEXT: 0x0000000100000f84 20 0 1 0 0 is_stmt end_sequence
+CHECK-NEXT: 0x0000000100000f90 11 0 1 0 0 is_stmt
+CHECK-NEXT: 0x0000000100000f9b 12 0 1 0 0 is_stmt prologue_end
+CHECK-NEXT: 0x0000000100000fa9 12 0 1 0 0 is_stmt end_sequence
+
+CHECK: .debug_pubnames contents:
+CHECK-NEXT: length = 0x00000017 version = 0x0002 unit_offset = 0x00000000 unit_size = 0x00000081
+CHECK-NEXT: Offset Name
+CHECK-NEXT: 0x00000026 "main"
+CHECK-NEXT: length = 0x00000036 version = 0x0002 unit_offset = 0x00000081 unit_size = 0x000000a5
+CHECK-NEXT: Offset Name
+CHECK-NEXT: 0x0000002d "private_int"
+CHECK-NEXT: 0x00000042 "baz"
+CHECK-NEXT: 0x00000057 "foo"
+CHECK-NEXT: 0x00000086 "inc"
+CHECK-NEXT: length = 0x00000026 version = 0x0002 unit_offset = 0x00000126 unit_size = 0x00000096
+CHECK-NEXT: Offset Name
+CHECK-NEXT: 0x00000026 "val"
+CHECK-NEXT: 0x00000048 "bar"
+CHECK-NEXT: 0x00000077 "inc"
+
+CHECK: .debug_pubtypes contents:
+CHECK-NEXT: length = 0x0000001f version = 0x0002 unit_offset = 0x00000000 unit_size = 0x00000081
+CHECK-NEXT: Offset Name
+CHECK-NEXT: 0x00000063 "int"
+CHECK-NEXT: 0x00000079 "char"
+CHECK-NEXT: length = 0x00000016 version = 0x0002 unit_offset = 0x00000081 unit_size = 0x000000a5
+CHECK-NEXT: Offset Name
+CHECK-NEXT: 0x00000026 "int"
+CHECK-NEXT: length = 0x00000016 version = 0x0002 unit_offset = 0x00000126 unit_size = 0x00000096
+CHECK-NEXT: Offset Name
+CHECK-NEXT: 0x00000041 "int"
diff --git a/test/tools/dsymutil/X86/basic-lto-dw4-linking-x86.test b/test/tools/dsymutil/X86/basic-lto-dw4-linking-x86.test
new file mode 100644
index 0000000..ad3ba5a
--- /dev/null
+++ b/test/tools/dsymutil/X86/basic-lto-dw4-linking-x86.test
@@ -0,0 +1,204 @@
+REQUIRES: shell
+RUN: llvm-dsymutil -o - -oso-prepend-path=%p/.. %p/../Inputs/basic-lto-dw4.macho.x86_64 | llvm-dwarfdump - | FileCheck %s
+
+CHECK: file format Mach-O 64-bit x86-64
+
+CHECK: debug_info contents
+
+CHECK: Compile Unit: {{.*}} version = 0x0004
+CHECK: DW_TAG_compile_unit [1] *
+CHECK: DW_AT_producer [DW_FORM_strp] ( .debug_str[0x00000001] = "clang version 3.7.0 ")
+CHECK: DW_AT_language [DW_FORM_data2] (DW_LANG_C99)
+CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000016] = "basic1.c")
+CHECK: DW_AT_stmt_list [DW_FORM_sec_offset] (0x00000000)
+CHECK: DW_AT_comp_dir [DW_FORM_strp] ( .debug_str[0x0000001f] = "/Inputs")
+CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000f40)
+CHECK: DW_AT_high_pc [DW_FORM_data4] (0x0000000b)
+CHECK: DW_TAG_subprogram [2] *
+CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000f40)
+CHECK: DW_AT_high_pc [DW_FORM_data4] (0x0000000b)
+CHECK: DW_AT_frame_base [DW_FORM_exprloc] (<0x1> 56 )
+CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000027] = "main")
+CHECK: DW_AT_decl_file [DW_FORM_data1] ("/Inputs{{[/\\]}}basic1.c")
+CHECK: DW_AT_prototyped [DW_FORM_flag_present] (true)
+CHECK: DW_AT_type [DW_FORM_ref_addr] (0x00000000000000a1)
+CHECK: DW_AT_external [DW_FORM_flag_present] (true)
+CHECK: DW_TAG_formal_parameter [3]
+CHECK: DW_AT_location [DW_FORM_exprloc] (<0x3> 55 93 04 )
+CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000002c] = "argc")
+CHECK: DW_AT_decl_file [DW_FORM_data1] ("/Inputs{{[/\\]}}basic1.c")
+CHECK: DW_AT_type [DW_FORM_ref_addr] (0x00000000000000a1)
+CHECK: DW_TAG_formal_parameter [4]
+CHECK: DW_AT_location [DW_FORM_exprloc] (<0x1> 54 )
+CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000031] = "argv")
+CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0060 => {0x00000060})
+CHECK: NULL
+CHECK: DW_TAG_pointer_type [5]
+CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0065 => {0x00000065})
+CHECK: DW_TAG_pointer_type [5]
+CHECK: DW_TAG_const_type [6]
+CHECK: DW_TAG_base_type [7]
+CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000036] = "char")
+CHECK: DW_AT_encoding [DW_FORM_data1] (DW_ATE_signed_char)
+CHECK: DW_AT_byte_size [DW_FORM_data1] (0x01)
+CHECK: NULL
+
+CHECK: Compile Unit:{{.*}} version = 0x0004
+
+CHECK: DW_TAG_compile_unit [1] *
+CHECK: DW_AT_producer [DW_FORM_strp] ( .debug_str[0x00000001] = "clang version 3.7.0 ")
+CHECK: DW_AT_language [DW_FORM_data2] (DW_LANG_C99)
+CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000003b] = "basic2.c")
+CHECK: DW_AT_stmt_list [DW_FORM_sec_offset] (0x00000044)
+CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000f50)
+CHECK: DW_AT_high_pc [DW_FORM_data4] (0x00000037)
+CHECK: DW_TAG_base_type [7]
+CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000044] = "int")
+CHECK: DW_TAG_variable [8]
+CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000048] = "baz")
+CHECK: DW_AT_location [DW_FORM_exprloc] (<0x9> 03 00 10 00 00 01 00 00 00 )
+CHECK: DW_TAG_variable [8]
+CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000004c] = "private_int")
+CHECK: DW_AT_decl_file [DW_FORM_data1] ("/Inputs{{[/\\]}}basic2.c")
+CHECK: DW_AT_location [DW_FORM_exprloc] (<0x9> 03 08 10 00 00 01 00 00 00 )
+CHECK: DW_TAG_subprogram [9]
+CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000058] = "inc")
+CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x002a => {0x000000a1})
+CHECK: DW_AT_inline [DW_FORM_data1] (DW_INL_inlined)
+CHECK: DW_TAG_subprogram [10] *
+CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000f50)
+CHECK: DW_AT_high_pc [DW_FORM_data4] (0x00000037)
+CHECK: DW_AT_frame_base [DW_FORM_exprloc] (<0x1> 56 )
+CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000005c] = "foo")
+CHECK: DW_AT_decl_file [DW_FORM_data1] ("/Inputs{{[/\\]}}basic2.c")
+CHECK: DW_AT_prototyped [DW_FORM_flag_present] (true)
+CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x002a => {0x000000a1})
+CHECK: DW_TAG_formal_parameter [11]
+CHECK: DW_AT_location [DW_FORM_sec_offset] (0x00000000)
+CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000060] = "arg")
+CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x002a => {0x000000a1})
+CHECK: DW_TAG_inlined_subroutine [12]
+CHECK: DW_AT_abstract_origin [DW_FORM_ref4] (cu + 0x005b => {0x000000d2} "inc")
+CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000f61)
+CHECK: DW_AT_high_pc [DW_FORM_data4] (0x0000000f)
+CHECK: NULL
+CHECK: NULL
+
+CHECK: Compile Unit: {{.*}} version = 0x0004
+
+CHECK: DW_TAG_compile_unit [1] *
+CHECK: DW_AT_producer [DW_FORM_strp] ( .debug_str[0x00000001] = "clang version 3.7.0 ")
+CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000064] = "basic3.c")
+CHECK: DW_AT_stmt_list [DW_FORM_sec_offset] (0x0000009a)
+CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000f90)
+CHECK: DW_AT_high_pc [DW_FORM_data4] (0x00000024)
+CHECK: DW_TAG_variable [13]
+CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000006d] = "val")
+CHECK: DW_AT_decl_file [DW_FORM_data1] ("/Inputs{{[/\\]}}basic3.c")
+CHECK: DW_AT_location [DW_FORM_exprloc] (<0x9> 03 04 10 00 00 01 00 00 00 )
+CHECK: DW_TAG_volatile_type [14]
+CHECK: DW_TAG_subprogram [15]
+CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000058] = "inc")
+CHECK: DW_AT_inline [DW_FORM_data1] (DW_INL_inlined)
+CHECK: DW_TAG_subprogram [2] *
+CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000f90)
+CHECK: DW_AT_high_pc [DW_FORM_data4] (0x00000024)
+CHECK: DW_AT_frame_base [DW_FORM_exprloc] (<0x1> 56 )
+CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000071] = "bar")
+CHECK: DW_TAG_formal_parameter [16]
+CHECK: DW_AT_location [DW_FORM_sec_offset] (0x00000025)
+CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000060] = "arg")
+CHECK: DW_TAG_inlined_subroutine [17]
+CHECK: DW_AT_abstract_origin [DW_FORM_ref4] (cu + 0x0044 => {0x0000015f} "inc")
+CHECK: DW_AT_ranges [DW_FORM_sec_offset] (0x00000000
+CHECK: [0x0000000100000f94 - 0x0000000100000f9a)
+CHECK: [0x0000000100000f9f - 0x0000000100000fa7))
+
+CHECK: NULL
+CHECK: NULL
+
+
+CHECK: .debug_loc contents:
+CHECK-NEXT: 0x00000000: Beginning address offset: 0x0000000000000000
+CHECK-NEXT: Ending address offset: 0x000000000000000c
+CHECK-NEXT: Location description: 55 93 04
+CHECK-NEXT: {{^$}}
+CHECK-NEXT: 0x00000025: Beginning address offset: 0x0000000000000000
+CHECK-NEXT: Ending address offset: 0x000000000000000f
+CHECK-NEXT: Location description: 55 93 04
+CHECK-NEXT: {{^$}}
+CHECK-NEXT: Beginning address offset: 0x0000000000000019
+CHECK-NEXT: Ending address offset: 0x000000000000001d
+CHECK-NEXT: Location description: 55 93 04
+
+CHECK: .debug_aranges contents:
+CHECK-NEXT: Address Range Header: length = 0x0000002c, version = 0x0002, cu_offset = 0x00000000, addr_size = 0x08, seg_size = 0x00
+CHECK-NEXT: [0x0000000100000f40 - 0x0000000100000f4b)
+CHECK-NEXT: Address Range Header: length = 0x0000002c, version = 0x0002, cu_offset = 0x00000077, addr_size = 0x08, seg_size = 0x00
+CHECK-NEXT: [0x0000000100000f50 - 0x0000000100000f87)
+CHECK-NEXT: Address Range Header: length = 0x0000002c, version = 0x0002, cu_offset = 0x0000011b, addr_size = 0x08, seg_size = 0x00
+CHECK-NEXT: [0x0000000100000f90 - 0x0000000100000fb4)
+
+CHECK: .debug_line contents:
+CHECK: Dir Mod Time File Len File Name
+CHECK-NEXT: ---- ---------- ---------- ---------------------------
+CHECK-NEXT: file_names[ 1] 0 0x00000000 0x00000000 basic1.c
+CHECK: Address Line Column File ISA Discriminator Flags
+CHECK-NEXT: ------------------ ------ ------ ------ --- ------------- -------------
+CHECK-NEXT: 0x0000000100000f40 26 0 1 0 0 is_stmt
+CHECK-NEXT: 0x0000000100000f44 27 10 1 0 0 is_stmt prologue_end
+CHECK-NEXT: 0x0000000100000f49 27 3 1 0 0
+CHECK-NEXT: 0x0000000100000f4b 27 3 1 0 0 end_sequence
+
+CHECK: Dir Mod Time File Len File Name
+CHECK-NEXT: ---- ---------- ---------- ---------------------------
+CHECK-NEXT: file_names[ 1] 0 0x00000000 0x00000000 basic2.c
+CHECK: Address Line Column File ISA Discriminator Flags
+CHECK-NEXT: ------------------ ------ ------ ------ --- ------------- -------------
+CHECK-NEXT: 0x0000000100000f50 19 0 1 0 0 is_stmt
+CHECK-NEXT: 0x0000000100000f54 20 18 1 0 0 is_stmt prologue_end
+CHECK-NEXT: 0x0000000100000f5a 20 17 1 0 0
+CHECK-NEXT: 0x0000000100000f5c 20 10 1 0 0
+CHECK-NEXT: 0x0000000100000f61 15 10 1 0 0 is_stmt
+CHECK-NEXT: 0x0000000100000f70 20 23 1 0 0 is_stmt
+CHECK-NEXT: 0x0000000100000f74 20 36 1 0 0
+CHECK-NEXT: 0x0000000100000f83 20 31 1 0 0
+CHECK-NEXT: 0x0000000100000f85 20 3 1 0 0
+CHECK-NEXT: 0x0000000100000f87 20 3 1 0 0 end_sequence
+
+CHECK: Dir Mod Time File Len File Name
+CHECK-NEXT: ---- ---------- ---------- ---------------------------
+CHECK-NEXT: file_names[ 1] 0 0x00000000 0x00000000 basic3.c
+CHECK: Address Line Column File ISA Discriminator Flags
+CHECK-NEXT: ------------------ ------ ------ ------ --- ------------- -------------
+CHECK-NEXT: 0x0000000100000f90 16 0 1 0 0 is_stmt
+CHECK-NEXT: 0x0000000100000f94 12 10 1 0 0 is_stmt prologue_end
+CHECK-NEXT: 0x0000000100000f9a 17 7 1 0 0 is_stmt
+CHECK-NEXT: 0x0000000100000f9f 12 10 1 0 0 is_stmt
+CHECK-NEXT: 0x0000000100000fa7 20 1 1 0 0 is_stmt
+CHECK-NEXT: 0x0000000100000fa9 19 18 1 0 0 is_stmt
+CHECK-NEXT: 0x0000000100000fab 19 10 1 0 0
+CHECK-NEXT: 0x0000000100000fb2 20 1 1 0 0 is_stmt
+CHECK-NEXT: 0x0000000100000fb4 20 1 1 0 0 is_stmt end_sequence
+
+CHECK: .debug_pubnames contents:
+CHECK-NEXT: length = 0x00000017 version = 0x0002 unit_offset = 0x00000000 unit_size = 0x00000077
+CHECK-NEXT: Offset Name
+CHECK-NEXT: 0x0000002a "main"
+CHECK-NEXT: length = 0x0000002e version = 0x0002 unit_offset = 0x00000077 unit_size = 0x000000a4
+CHECK-NEXT: Offset Name
+CHECK-NEXT: 0x00000031 "baz"
+CHECK-NEXT: 0x00000046 "private_int"
+CHECK-NEXT: 0x00000067 "foo"
+CHECK-NEXT: length = 0x0000001e version = 0x0002 unit_offset = 0x0000011b unit_size = 0x00000085
+CHECK-NEXT: Offset Name
+CHECK-NEXT: 0x0000002a "val"
+CHECK-NEXT: 0x00000050 "bar"
+
+CHECK: .debug_pubtypes contents:
+CHECK-NEXT: length = 0x00000017 version = 0x0002 unit_offset = 0x00000000 unit_size = 0x00000077
+CHECK-NEXT: Offset Name
+CHECK-NEXT: 0x0000006f "char"
+CHECK-NEXT: length = 0x00000016 version = 0x0002 unit_offset = 0x00000077 unit_size = 0x000000a4
+CHECK-NEXT: Offset Name
+CHECK-NEXT: 0x0000002a "int"
diff --git a/test/tools/dsymutil/X86/basic-lto-linking-x86.test b/test/tools/dsymutil/X86/basic-lto-linking-x86.test
new file mode 100644
index 0000000..22b6e08
--- /dev/null
+++ b/test/tools/dsymutil/X86/basic-lto-linking-x86.test
@@ -0,0 +1,207 @@
+REQUIRES: shell
+RUN: llvm-dsymutil -o - -oso-prepend-path=%p/.. %p/../Inputs/basic-lto.macho.x86_64 | llvm-dwarfdump - | FileCheck %s
+
+CHECK: file format Mach-O 64-bit x86-64
+
+CHECK: debug_info contents
+
+CHECK: Compile Unit:
+
+CHECK: DW_TAG_compile_unit [1] *
+CHECK: DW_AT_producer [DW_FORM_strp] ( .debug_str[0x00000001] = "Apple LLVM version 6.0 (clang-600.0.39) (based on LLVM 3.5svn)")
+CHECK: DW_AT_language [DW_FORM_data2] (DW_LANG_C99)
+CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000040] = "basic1.c")
+CHECK: DW_AT_stmt_list [DW_FORM_data4] (0x00000000)
+CHECK: DW_AT_comp_dir [DW_FORM_strp] ( .debug_str[0x00000049] = "/Inputs")
+CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000f40)
+CHECK: DW_TAG_subprogram [2] *
+CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000051] = "main")
+CHECK: DW_AT_decl_file [DW_FORM_data1] ("/Inputs{{[/\\]}}basic1.c")
+CHECK: DW_AT_decl_line [DW_FORM_data1] (23)
+CHECK: DW_AT_prototyped [DW_FORM_flag] (0x01)
+CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0063 => {0x00000063})
+CHECK: DW_AT_external [DW_FORM_flag] (0x01)
+CHECK: DW_AT_accessibility [DW_FORM_data1] (DW_ACCESS_public)
+CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000f40)
+CHECK: DW_AT_high_pc [DW_FORM_addr] (0x0000000100000f4b)
+CHECK: DW_AT_frame_base [DW_FORM_block1] (<0x01> 56 )
+CHECK: DW_TAG_formal_parameter [3]
+CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000056] = "argc")
+CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0063 => {0x00000063})
+CHECK: DW_AT_location [DW_FORM_block1] (<0x03> 55 93 04 )
+CHECK: DW_TAG_formal_parameter [3]
+CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000005b] = "argv")
+CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x006a => {0x0000006a})
+CHECK: DW_AT_location [DW_FORM_block1] (<0x01> 54 )
+CHECK: NULL
+CHECK: DW_TAG_base_type [4]
+CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000060] = "int")
+CHECK: DW_AT_encoding [DW_FORM_data1] (DW_ATE_signed)
+CHECK: DW_AT_byte_size [DW_FORM_data1] (0x04)
+CHECK: DW_TAG_pointer_type [5]
+CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x006f => {0x0000006f})
+CHECK: DW_TAG_pointer_type [5]
+CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0074 => {0x00000074})
+CHECK: DW_TAG_const_type [6]
+CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0079 => {0x00000079})
+CHECK: DW_TAG_base_type [4]
+CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000064] = "char")
+CHECK: DW_AT_encoding [DW_FORM_data1] (DW_ATE_signed_char)
+CHECK: DW_AT_byte_size [DW_FORM_data1] (0x01)
+CHECK: NULL
+
+CHECK: Compile Unit:
+
+CHECK: DW_TAG_compile_unit [1] *
+CHECK: DW_AT_producer [DW_FORM_strp] ( .debug_str[0x00000001] = "Apple LLVM version 6.0 (clang-600.0.39) (based on LLVM 3.5svn)")
+CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000069] = "basic2.c")
+CHECK: DW_AT_stmt_list [DW_FORM_data4] (0x0000003e)
+CHECK: DW_AT_comp_dir [DW_FORM_strp] ( .debug_str[0x00000049] = "/Inputs")
+CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000f50)
+CHECK: DW_TAG_variable [7]
+CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000072] = "private_int")
+CHECK: DW_AT_type [DW_FORM_ref_addr] (0x0000000000000063)
+CHECK: DW_AT_decl_file [DW_FORM_data1] ("/Inputs{{[/\\]}}basic2.c")
+CHECK: DW_AT_location [DW_FORM_block1] (<0x09> 03 08 10 00 00 01 00 00 00 )
+CHECK: DW_TAG_variable [7]
+CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000007e] = "baz")
+CHECK: DW_AT_type [DW_FORM_ref_addr] (0x0000000000000063)
+CHECK: DW_AT_location [DW_FORM_block1] (<0x09> 03 00 10 00 00 01 00 00 00 )
+CHECK: DW_TAG_subprogram [8] *
+CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000082] = "foo")
+CHECK: DW_AT_type [DW_FORM_ref_addr] (0x0000000000000063)
+CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000f50)
+CHECK: DW_AT_high_pc [DW_FORM_addr] (0x0000000100000f89)
+CHECK: DW_AT_frame_base [DW_FORM_block1] (<0x01> 56 )
+CHECK: DW_TAG_formal_parameter [9]
+CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000086] = "arg")
+CHECK: DW_AT_type [DW_FORM_ref_addr] (0x0000000000000063)
+CHECK: DW_AT_location [DW_FORM_data4] (0x00000000)
+CHECK: DW_TAG_inlined_subroutine [10]
+CHECK: DW_AT_abstract_origin [DW_FORM_ref4] (cu + 0x00a7 => {0x00000128} "inc")
+CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000f63)
+CHECK: DW_AT_high_pc [DW_FORM_addr] (0x0000000100000f72)
+CHECK: DW_AT_call_line [DW_FORM_data1] (20)
+CHECK: NULL
+CHECK: DW_TAG_subprogram [11]
+CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000008a] = "inc")
+CHECK: DW_AT_type [DW_FORM_ref_addr] (0x0000000000000063)
+CHECK: DW_AT_inline [DW_FORM_data1] (DW_INL_inlined)
+CHECK: NULL
+
+CHECK: Compile Unit:
+
+CHECK: DW_TAG_compile_unit [1] *
+CHECK: DW_AT_producer [DW_FORM_strp] ( .debug_str[0x00000001] = "Apple LLVM version 6.0 (clang-600.0.39) (based on LLVM 3.5svn)")
+CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000008e] = "basic3.c")
+CHECK: DW_AT_stmt_list [DW_FORM_data4] (0x0000007e)
+CHECK: DW_AT_comp_dir [DW_FORM_strp] ( .debug_str[0x00000049] = "/Inputs")
+CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000f90)
+CHECK: DW_TAG_variable [12]
+CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000097] = "val")
+CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x003c => {0x00000176})
+CHECK: DW_AT_decl_file [DW_FORM_data1] ("/Inputs{{[/\\]}}basic3.c")
+CHECK: DW_AT_location [DW_FORM_block1] (<0x09> 03 04 10 00 00 01 00 00 00 )
+CHECK: DW_TAG_volatile_type [13]
+CHECK: DW_AT_type [DW_FORM_ref_addr] (0x0000000000000063)
+CHECK: DW_TAG_subprogram [8] *
+CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000009b] = "bar")
+CHECK: DW_AT_type [DW_FORM_ref_addr] (0x0000000000000063)
+CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000f90)
+CHECK: DW_AT_high_pc [DW_FORM_addr] (0x0000000100000fb4)
+CHECK: DW_AT_frame_base [DW_FORM_block1] (<0x01> 56 )
+CHECK: DW_TAG_formal_parameter [9]
+CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000086] = "arg")
+CHECK: DW_AT_type [DW_FORM_ref_addr] (0x0000000000000063)
+CHECK: DW_AT_location [DW_FORM_data4] (0x00000025)
+CHECK: DW_TAG_lexical_block [14] *
+CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000f94)
+CHECK DW_AT_high_pc [DW_FORM_addr] (0x0000000100000fa7)
+CHECK: DW_TAG_inlined_subroutine [15]
+CHECK: DW_AT_abstract_origin [DW_FORM_ref4] (cu + 0x009a => {0x000001d4} "inc")
+CHECK: DW_AT_ranges [DW_FORM_data4] (0x00000000
+CHECK: [0x0000000100000f94 - 0x0000000100000f9a)
+CHECK: [0x0000000100000f9f - 0x0000000100000fa7))
+CHECK: NULL
+CHECK: NULL
+CHECK: DW_TAG_subprogram [11]
+CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000008a] = "inc")
+CHECK: DW_AT_type [DW_FORM_ref_addr] (0x0000000000000063)
+CHECK: NULL
+
+CHECK:.debug_loc contents:
+CHECK-NEXT: 0x00000000: Beginning address offset: 0x0000000000000000
+CHECK-NEXT: Ending address offset: 0x000000000000000e
+CHECK-NEXT: Location description: 55 93 04
+CHECK-NEXT: {{^$}}
+CHECK-NEXT: 0x00000025: Beginning address offset: 0x0000000000000000
+CHECK-NEXT: Ending address offset: 0x000000000000000f
+CHECK-NEXT: Location description: 55 93 04
+CHECK-NEXT: {{^$}}
+CHECK-NEXT: Beginning address offset: 0x0000000000000019
+CHECK-NEXT: Ending address offset: 0x000000000000001d
+CHECK-NEXT: Location description: 55 93 04
+
+CHECK: .debug_aranges contents:
+CHECK-NEXT: Address Range Header: length = 0x0000002c, version = 0x0002, cu_offset = 0x00000000, addr_size = 0x08, seg_size = 0x00
+CHECK-NEXT: [0x0000000100000f40 - 0x0000000100000f4b)
+CHECK-NEXT: Address Range Header: length = 0x0000002c, version = 0x0002, cu_offset = 0x00000081, addr_size = 0x08, seg_size = 0x00
+CHECK-NEXT: [0x0000000100000f50 - 0x0000000100000f89)
+CHECK-NEXT: Address Range Header: length = 0x0000002c, version = 0x0002, cu_offset = 0x0000013a, addr_size = 0x08, seg_size = 0x00
+CHECK-NEXT: [0x0000000100000f90 - 0x0000000100000fb4)
+
+
+CHECK: .debug_line contents
+CHECK: Dir Mod Time File Len File Name
+CHECK-NEXT: ---- ---------- ---------- ---------------------------
+CHECK-NEXT: file_names[ 1] 0 0x00000000 0x00000000 basic1.c
+CHECK: Address Line Column File ISA Discriminator Flags
+CHECK-NEXT: ------------------ ------ ------ ------ --- ------------- -------------
+CHECK-NEXT: 0x0000000100000f40 23 0 1 0 0 is_stmt
+CHECK-NEXT: 0x0000000100000f44 24 0 1 0 0 is_stmt prologue_end
+CHECK-NEXT: 0x0000000100000f4b 24 0 1 0 0 is_stmt end_sequence
+
+CHECK: Dir Mod Time File Len File Name
+CHECK-NEXT: ---- ---------- ---------- ---------------------------
+CHECK-NEXT: file_names[ 1] 0 0x00000000 0x00000000 basic2.c
+CHECK: Address Line Column File ISA Discriminator Flags
+CHECK-NEXT: ------------------ ------ ------ ------ --- ------------- -------------
+CHECK-NEXT: 0x0000000100000f50 19 0 1 0 0 is_stmt
+CHECK-NEXT: 0x0000000100000f54 20 0 1 0 0 is_stmt prologue_end
+CHECK-NEXT: 0x0000000100000f63 15 0 1 0 0 is_stmt
+CHECK-NEXT: 0x0000000100000f72 20 0 1 0 0 is_stmt
+CHECK-NEXT: 0x0000000100000f89 20 0 1 0 0 is_stmt end_sequence
+
+CHECK: Dir Mod Time File Len File Name
+CHECK-NEXT: ---- ---------- ---------- ---------------------------
+CHECK-NEXT: file_names[ 1] 0 0x00000000 0x00000000 basic3.c
+CHECK: Address Line Column File ISA Discriminator Flags
+CHECK-NEXT: ------------------ ------ ------ ------ --- ------------- -------------
+CHECK-NEXT: 0x0000000100000f90 16 0 1 0 0 is_stmt
+CHECK-NEXT: 0x0000000100000f94 12 0 1 0 0 is_stmt prologue_end
+CHECK-NEXT: 0x0000000100000f9a 17 0 1 0 0 is_stmt
+CHECK-NEXT: 0x0000000100000f9f 12 0 1 0 0 is_stmt
+CHECK-NEXT: 0x0000000100000fa7 20 0 1 0 0 is_stmt
+CHECK-NEXT: 0x0000000100000fa9 19 0 1 0 0 is_stmt
+CHECK-NEXT: 0x0000000100000fb2 20 0 1 0 0 is_stmt
+CHECK-NEXT: 0x0000000100000fb4 20 0 1 0 0 is_stmt end_sequence
+
+CHECK: .debug_pubnames contents:
+CHECK-NEXT: length = 0x00000017 version = 0x0002 unit_offset = 0x00000000 unit_size = 0x00000081
+CHECK-NEXT: Offset Name
+CHECK-NEXT: 0x00000026 "main"
+CHECK-NEXT: length = 0x0000002e version = 0x0002 unit_offset = 0x00000081 unit_size = 0x000000b9
+CHECK-NEXT: Offset Name
+CHECK-NEXT: 0x00000026 "private_int"
+CHECK-NEXT: 0x0000003f "baz"
+CHECK-NEXT: 0x00000058 "foo"
+CHECK-NEXT: length = 0x0000001e version = 0x0002 unit_offset = 0x0000013a unit_size = 0x000000ac
+CHECK-NEXT: Offset Name
+CHECK-NEXT: 0x00000026 "val"
+CHECK-NEXT: 0x00000045 "bar"
+
+CHECK: .debug_pubtypes contents:
+CHECK-NEXT: length = 0x0000001f version = 0x0002 unit_offset = 0x00000000 unit_size = 0x00000081
+CHECK-NEXT: Offset Name
+CHECK-NEXT: 0x00000063 "int"
+CHECK-NEXT: 0x00000079 "char"
diff --git a/test/tools/dsymutil/X86/lit.local.cfg b/test/tools/dsymutil/X86/lit.local.cfg
new file mode 100644
index 0000000..c8625f4
--- /dev/null
+++ b/test/tools/dsymutil/X86/lit.local.cfg
@@ -0,0 +1,2 @@
+if not 'X86' in config.root.targets:
+ config.unsupported = True
diff --git a/test/tools/dsymutil/basic-linking.test b/test/tools/dsymutil/basic-linking.test
index 5de6c13..ec6a5b7 100644
--- a/test/tools/dsymutil/basic-linking.test
+++ b/test/tools/dsymutil/basic-linking.test
@@ -1,6 +1,6 @@
-RUN: llvm-dsymutil -v -oso-prepend-path=%p %p/Inputs/basic.macho.x86_64 | FileCheck %s
-RUN: llvm-dsymutil -v -oso-prepend-path=%p %p/Inputs/basic-lto.macho.x86_64 | FileCheck %s --check-prefix=CHECK-LTO
-RUN: llvm-dsymutil -v -oso-prepend-path=%p %p/Inputs/basic-archive.macho.x86_64 | FileCheck %s --check-prefix=CHECK-ARCHIVE
+RUN: llvm-dsymutil -no-output -v -oso-prepend-path=%p %p/Inputs/basic.macho.x86_64 | FileCheck %s
+RUN: llvm-dsymutil -no-output -v -oso-prepend-path=%p %p/Inputs/basic-lto.macho.x86_64 | FileCheck %s --check-prefix=CHECK-LTO
+RUN: llvm-dsymutil -no-output -v -oso-prepend-path=%p %p/Inputs/basic-archive.macho.x86_64 | FileCheck %s --check-prefix=CHECK-ARCHIVE
This test check the basic Dwarf linking process through the debug dumps.
diff --git a/test/tools/dsymutil/debug-map-parsing.test b/test/tools/dsymutil/debug-map-parsing.test
index b64ad9f..3422316 100644
--- a/test/tools/dsymutil/debug-map-parsing.test
+++ b/test/tools/dsymutil/debug-map-parsing.test
@@ -10,16 +10,16 @@ Check that We can parse the debug map of the basic executable.
CHECK-NOT: error
CHECK: DEBUG MAP: x86_64-unknown-unknown-macho
CHECK: /Inputs/basic1.macho.x86_64.o:
-CHECK: 0000000000000000 => 0000000100000ea0 _main
+CHECK: 0000000000000000 => 0000000100000ea0+0x24 _main
CHECK: /Inputs/basic2.macho.x86_64.o:
-CHECK: 0000000000000310 => 0000000100001000 _baz
-CHECK: 0000000000000020 => 0000000100000ed0 _foo
-CHECK: 0000000000000070 => 0000000100000f20 _inc
-CHECK: 0000000000000560 => 0000000100001008 _private_int
+CHECK: 0000000000000310 => 0000000100001000+0x0 _baz
+CHECK: 0000000000000020 => 0000000100000ed0+0x50 _foo
+CHECK: 0000000000000070 => 0000000100000f20+0x17 _inc
+CHECK: 0000000000000560 => 0000000100001008+0x0 _private_int
CHECK: /Inputs/basic3.macho.x86_64.o:
-CHECK: 0000000000000020 => 0000000100000f40 _bar
-CHECK: 0000000000000070 => 0000000100000f90 _inc
-CHECK: 0000000000000004 => 0000000100001004 _val
+CHECK: 0000000000000020 => 0000000100000f40+0x50 _bar
+CHECK: 0000000000000070 => 0000000100000f90+0x19 _inc
+CHECK: 0000000000000004 => 0000000100001004+0x0 _val
CHECK: END DEBUG MAP
@@ -28,12 +28,12 @@ Check that we can parse the debug-map of the basic-lto executable
CHECK-LTO-NOT: error
CHECK-LTO: DEBUG MAP: x86_64-unknown-unknown-macho
CHECK-LTO: /Inputs/basic-lto.macho.x86_64.o:
-CHECK-LTO: 0000000000000050 => 0000000100000f90 _bar
-CHECK-LTO: 0000000000000658 => 0000000100001000 _baz
-CHECK-LTO: 0000000000000010 => 0000000100000f50 _foo
-CHECK-LTO: 0000000000000000 => 0000000100000f40 _main
-CHECK-LTO: 00000000000008e8 => 0000000100001008 _private_int
-CHECK-LTO: 00000000000008ec => 0000000100001004 _val
+CHECK-LTO: 0000000000000050 => 0000000100000f90+0x24 _bar
+CHECK-LTO: 0000000000000658 => 0000000100001000+0x0 _baz
+CHECK-LTO: 0000000000000010 => 0000000100000f50+0x40 _foo
+CHECK-LTO: 0000000000000000 => 0000000100000f40+0x10 _main
+CHECK-LTO: 00000000000008e8 => 0000000100001008+0x0 _private_int
+CHECK-LTO: 00000000000008ec => 0000000100001004+0x0 _val
CHECK-LTO: END DEBUG MAP
Check thet we correctly handle debug maps with archive members (including only
@@ -51,16 +51,16 @@ CHECK-ARCHIVE-NEXT: found member in current archive.
CHECK-ARCHIVE: DEBUG MAP: x86_64-unknown-unknown-macho
CHECK-ARCHIVE: object addr => executable addr symbol name
CHECK-ARCHIVE: /Inputs/basic1.macho.x86_64.o:
-CHECK-ARCHIVE: 0000000000000000 => 0000000100000ea0 _main
+CHECK-ARCHIVE: 0000000000000000 => 0000000100000ea0+0x24 _main
CHECK-ARCHIVE: /Inputs/./libbasic.a(basic2.macho.x86_64.o):
-CHECK-ARCHIVE: 0000000000000310 => 0000000100001000 _baz
-CHECK-ARCHIVE: 0000000000000020 => 0000000100000ed0 _foo
-CHECK-ARCHIVE: 0000000000000070 => 0000000100000f20 _inc
-CHECK-ARCHIVE: 0000000000000560 => 0000000100001004 _private_int
+CHECK-ARCHIVE: 0000000000000310 => 0000000100001000+0x0 _baz
+CHECK-ARCHIVE: 0000000000000020 => 0000000100000ed0+0x50 _foo
+CHECK-ARCHIVE: 0000000000000070 => 0000000100000f20+0x17 _inc
+CHECK-ARCHIVE: 0000000000000560 => 0000000100001004+0x0 _private_int
CHECK-ARCHIVE: /Inputs/./libbasic.a(basic3.macho.x86_64.o):
-CHECK-ARCHIVE: 0000000000000020 => 0000000100000f40 _bar
-CHECK-ARCHIVE: 0000000000000070 => 0000000100000f90 _inc
-CHECK-ARCHIVE: 0000000000000004 => 0000000100001008 _val
+CHECK-ARCHIVE: 0000000000000020 => 0000000100000f40+0x50 _bar
+CHECK-ARCHIVE: 0000000000000070 => 0000000100000f90+0x19 _inc
+CHECK-ARCHIVE: 0000000000000004 => 0000000100001008+0x0 _val
CHECK-ARCHIVE: END DEBUG MAP
Check that we warn about missing object files (this presumes that the files aren't
diff --git a/test/tools/gold/mtriple.ll b/test/tools/gold/mtriple.ll
index 94211ed..87b2260 100644
--- a/test/tools/gold/mtriple.ll
+++ b/test/tools/gold/mtriple.ll
@@ -1,3 +1,5 @@
+; REQUIRES: ld_emu_elf32ppc
+
; RUN: llvm-as %s -o %t.o
; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so -m elf32ppc \
; RUN: -plugin-opt=mtriple=powerpc-linux-gnu \
diff --git a/test/tools/gold/opt-level.ll b/test/tools/gold/opt-level.ll
new file mode 100644
index 0000000..3deb0af
--- /dev/null
+++ b/test/tools/gold/opt-level.ll
@@ -0,0 +1,50 @@
+; RUN: llvm-as -o %t.bc %s
+; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so -plugin-opt=save-temps \
+; RUN: -plugin-opt=O0 -r -o %t.o %t.bc
+; RUN: llvm-dis < %t.o.opt.bc -o - | FileCheck --check-prefix=CHECK-O0 %s
+; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so -plugin-opt=save-temps \
+; RUN: -plugin-opt=O1 -r -o %t.o %t.bc
+; RUN: llvm-dis < %t.o.opt.bc -o - | FileCheck --check-prefix=CHECK-O1 %s
+; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so -plugin-opt=save-temps \
+; RUN: -plugin-opt=O2 -r -o %t.o %t.bc
+; RUN: llvm-dis < %t.o.opt.bc -o - | FileCheck --check-prefix=CHECK-O2 %s
+
+; CHECK-O0: define internal void @foo(
+; CHECK-O1: define internal void @foo(
+; CHECK-O2-NOT: define internal void @foo(
+define internal void @foo() {
+ ret void
+}
+
+; CHECK-O0: define internal i32 @bar(
+; CHECK-O1: define internal i32 @bar(
+define internal i32 @bar(i1 %p) {
+ br i1 %p, label %t, label %f
+
+t:
+ br label %end
+
+f:
+ br label %end
+
+end:
+ ; CHECK-O0: phi
+ ; CHECK-O1: select
+ %r = phi i32 [ 1, %t ], [ 2, %f ]
+ ret i32 %r
+}
+
+define void @baz() {
+ call void @foo()
+ %c = call i32 @bar(i1 true)
+ ret void
+}
+
+@a = constant i32 1
+
+!0 = !{!"bitset1", i32* @a, i32 0}
+
+; CHECK-O0-NOT: llvm.bitsets
+; CHECK-O1-NOT: llvm.bitsets
+; CHECK-O2-NOT: llvm.bitsets
+!llvm.bitsets = !{ !0 }
diff --git a/test/tools/gold/option.ll b/test/tools/gold/option.ll
deleted file mode 100644
index 59e3f1e..0000000
--- a/test/tools/gold/option.ll
+++ /dev/null
@@ -1,39 +0,0 @@
-; RUN: llvm-as %s -o %t.o
-; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so -m elf_x86_64 \
-; RUN: --plugin-opt=-jump-table-type=arity \
-; RUN: --plugin-opt=-mattr=+aes \
-; RUN: --plugin-opt=mcpu=core-avx2 \
-; RUN: -shared %t.o -o %t2.o
-; RUN: llvm-nm %t2.o | FileCheck %s
-
-; CHECK: t __llvm_jump_instr_table_0_1
-; CHECK: t __llvm_jump_instr_table_1_1
-
-target triple = "x86_64-unknown-linux-gnu"
-define i32 @g(i32 %a) unnamed_addr jumptable {
- ret i32 %a
-}
-
-define i32 (i32)* @get_g() {
- ret i32 (i32)* @g
-}
-
-define i32 @f() unnamed_addr jumptable {
- ret i32 0
-}
-
-define i32 ()* @get_f() {
- ret i32 ()* @f
-}
-
-define <2 x i64> @test_aes(<2 x i64> %a0, <2 x i64> %a1) {
- %res = call <2 x i64> @llvm.x86.aesni.aesenc(<2 x i64> %a0, <2 x i64> %a1)
- ret <2 x i64> %res
-}
-declare <2 x i64> @llvm.x86.aesni.aesenc(<2 x i64>, <2 x i64>) nounwind readnone
-
-define <32 x i8> @test_avx2(<16 x i16> %a0, <16 x i16> %a1) {
- %res = call <32 x i8> @llvm.x86.avx2.packuswb(<16 x i16> %a0, <16 x i16> %a1)
- ret <32 x i8> %res
-}
-declare <32 x i8> @llvm.x86.avx2.packuswb(<16 x i16>, <16 x i16>) nounwind readnone
diff --git a/test/tools/gold/pr19901.ll b/test/tools/gold/pr19901.ll
index 2a7dea1..71bb134 100644
--- a/test/tools/gold/pr19901.ll
+++ b/test/tools/gold/pr19901.ll
@@ -1,6 +1,7 @@
; RUN: llc %s -o %t.o -filetype=obj -relocation-model=pic
; RUN: llvm-as %p/Inputs/pr19901-1.ll -o %t2.o
-; RUN: %gold -shared -o %t.so -plugin %llvmshlibdir/LLVMgold.so %t2.o %t.o
+; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so \
+; RUN: -shared -m elf_x86_64 -o %t.so %t2.o %t.o
; RUN: llvm-readobj -t %t.so | FileCheck %s
; CHECK: Symbol {
diff --git a/test/tools/gold/remarks.ll b/test/tools/gold/remarks.ll
new file mode 100644
index 0000000..c4fa7f7
--- /dev/null
+++ b/test/tools/gold/remarks.ll
@@ -0,0 +1,22 @@
+; RUN: llvm-as %s -o %t.o
+
+; RUN: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold.so \
+; RUN: -plugin-opt=-pass-remarks=inline %t.o -o %t2.o 2>&1 | FileCheck %s
+
+; RUN: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold.so \
+; RUN: %t.o -o %t2.o 2>&1 | FileCheck -allow-empty --check-prefix=NO-REMARK %s
+
+
+; CHECK: f inlined into _start
+; NO-REMARK-NOT: inlined
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
+
+define i32 @f() {
+ ret i32 0
+}
+
+define i32 @_start() {
+ %call = call i32 @f()
+ ret i32 %call
+}
diff --git a/test/tools/gold/slp-vectorize.ll b/test/tools/gold/slp-vectorize.ll
index d39aa76..a75f0b3 100644
--- a/test/tools/gold/slp-vectorize.ll
+++ b/test/tools/gold/slp-vectorize.ll
@@ -11,19 +11,19 @@
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
define void @f(float* nocapture %x) {
- %tmp = load float* %x, align 4
+ %tmp = load float, float* %x, align 4
%add = fadd float %tmp, 1.000000e+00
store float %add, float* %x, align 4
- %arrayidx1 = getelementptr inbounds float* %x, i64 1
- %tmp1 = load float* %arrayidx1, align 4
+ %arrayidx1 = getelementptr inbounds float, float* %x, i64 1
+ %tmp1 = load float, float* %arrayidx1, align 4
%add2 = fadd float %tmp1, 1.000000e+00
store float %add2, float* %arrayidx1, align 4
- %arrayidx3 = getelementptr inbounds float* %x, i64 2
- %tmp2 = load float* %arrayidx3, align 4
+ %arrayidx3 = getelementptr inbounds float, float* %x, i64 2
+ %tmp2 = load float, float* %arrayidx3, align 4
%add4 = fadd float %tmp2, 1.000000e+00
store float %add4, float* %arrayidx3, align 4
- %arrayidx5 = getelementptr inbounds float* %x, i64 3
- %tmp3 = load float* %arrayidx5, align 4
+ %arrayidx5 = getelementptr inbounds float, float* %x, i64 3
+ %tmp3 = load float, float* %arrayidx5, align 4
%add6 = fadd float %tmp3, 1.000000e+00
store float %add6, float* %arrayidx5, align 4
ret void
diff --git a/test/tools/gold/vectorize.ll b/test/tools/gold/vectorize.ll
index c1626d7..5f003dd 100644
--- a/test/tools/gold/vectorize.ll
+++ b/test/tools/gold/vectorize.ll
@@ -1,6 +1,6 @@
; RUN: llvm-as %s -o %t.o
-; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so \
+; RUN: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold.so \
; RUN: --plugin-opt=save-temps \
; RUN: -shared %t.o -o %t2.o
; RUN: llvm-dis %t2.o.opt.bc -o - | FileCheck %s
@@ -17,8 +17,8 @@ bb:
bb1:
%i.0 = phi i64 [ 0, %bb ], [ %tmp4, %bb1 ]
- %tmp = getelementptr inbounds float* %x, i64 %i.0
- %tmp2 = load float* %tmp, align 4
+ %tmp = getelementptr inbounds float, float* %x, i64 %i.0
+ %tmp2 = load float, float* %tmp, align 4
%tmp3 = fadd float %tmp2, 1.000000e+00
store float %tmp3, float* %tmp, align 4
%tmp4 = add nsw i64 %i.0, 1
diff --git a/test/tools/llvm-cov/Inputs/binary-formats.macho32b b/test/tools/llvm-cov/Inputs/binary-formats.macho32b
new file mode 100755
index 0000000..bb9f356
--- /dev/null
+++ b/test/tools/llvm-cov/Inputs/binary-formats.macho32b
Binary files differ
diff --git a/test/tools/llvm-cov/Inputs/binary-formats.macho32l b/test/tools/llvm-cov/Inputs/binary-formats.macho32l
new file mode 100755
index 0000000..2dd4c44
--- /dev/null
+++ b/test/tools/llvm-cov/Inputs/binary-formats.macho32l
Binary files differ
diff --git a/test/tools/llvm-cov/Inputs/binary-formats.macho64l b/test/tools/llvm-cov/Inputs/binary-formats.macho64l
new file mode 100755
index 0000000..0045c43
--- /dev/null
+++ b/test/tools/llvm-cov/Inputs/binary-formats.macho64l
Binary files differ
diff --git a/test/tools/llvm-cov/Inputs/binary-formats.proftext b/test/tools/llvm-cov/Inputs/binary-formats.proftext
new file mode 100644
index 0000000..97816c2
--- /dev/null
+++ b/test/tools/llvm-cov/Inputs/binary-formats.proftext
@@ -0,0 +1,4 @@
+main
+0x0
+1
+100
diff --git a/test/tools/llvm-cov/Inputs/lineExecutionCounts.profdata b/test/tools/llvm-cov/Inputs/lineExecutionCounts.profdata
deleted file mode 100644
index 8712227..0000000
--- a/test/tools/llvm-cov/Inputs/lineExecutionCounts.profdata
+++ /dev/null
Binary files differ
diff --git a/test/tools/llvm-cov/Inputs/lineExecutionCounts.proftext b/test/tools/llvm-cov/Inputs/lineExecutionCounts.proftext
new file mode 100644
index 0000000..1966d42
--- /dev/null
+++ b/test/tools/llvm-cov/Inputs/lineExecutionCounts.proftext
@@ -0,0 +1,8 @@
+main
+0x000000000028434d
+5
+1
+0
+100
+1
+0
diff --git a/test/tools/llvm-cov/Inputs/regionMarkers.profdata b/test/tools/llvm-cov/Inputs/regionMarkers.profdata
deleted file mode 100644
index 8712227..0000000
--- a/test/tools/llvm-cov/Inputs/regionMarkers.profdata
+++ /dev/null
Binary files differ
diff --git a/test/tools/llvm-cov/Inputs/regionMarkers.proftext b/test/tools/llvm-cov/Inputs/regionMarkers.proftext
new file mode 100644
index 0000000..1966d42
--- /dev/null
+++ b/test/tools/llvm-cov/Inputs/regionMarkers.proftext
@@ -0,0 +1,8 @@
+main
+0x000000000028434d
+5
+1
+0
+100
+1
+0
diff --git a/test/tools/llvm-cov/Inputs/test_exit_block_arcs.gcda b/test/tools/llvm-cov/Inputs/test_exit_block_arcs.gcda
new file mode 100644
index 0000000..3ca483d
--- /dev/null
+++ b/test/tools/llvm-cov/Inputs/test_exit_block_arcs.gcda
Binary files differ
diff --git a/test/tools/llvm-cov/Inputs/test_exit_block_arcs.gcno b/test/tools/llvm-cov/Inputs/test_exit_block_arcs.gcno
new file mode 100644
index 0000000..d453566
--- /dev/null
+++ b/test/tools/llvm-cov/Inputs/test_exit_block_arcs.gcno
Binary files differ
diff --git a/test/tools/llvm-cov/Inputs/universal-binary b/test/tools/llvm-cov/Inputs/universal-binary
new file mode 100755
index 0000000..aad5758
--- /dev/null
+++ b/test/tools/llvm-cov/Inputs/universal-binary
Binary files differ
diff --git a/test/tools/llvm-cov/Inputs/universal-binary.proftext b/test/tools/llvm-cov/Inputs/universal-binary.proftext
new file mode 100644
index 0000000..97816c2
--- /dev/null
+++ b/test/tools/llvm-cov/Inputs/universal-binary.proftext
@@ -0,0 +1,4 @@
+main
+0x0
+1
+100
diff --git a/test/tools/llvm-cov/binary-formats.c b/test/tools/llvm-cov/binary-formats.c
new file mode 100644
index 0000000..31c6c4c
--- /dev/null
+++ b/test/tools/llvm-cov/binary-formats.c
@@ -0,0 +1,9 @@
+// Checks for reading various formats.
+
+// CHECK: 100| [[@LINE+1]]|int main
+int main(int argc, const char *argv[]) {}
+
+// RUN: llvm-profdata merge %S/Inputs/binary-formats.proftext -o %t.profdata
+// RUN: llvm-cov show %S/Inputs/binary-formats.macho32l -instr-profile %t.profdata -filename-equivalence %s | FileCheck %s
+// RUN: llvm-cov show %S/Inputs/binary-formats.macho64l -instr-profile %t.profdata -filename-equivalence %s | FileCheck %s
+// RUN: llvm-cov show %S/Inputs/binary-formats.macho32b -instr-profile %t.profdata -filename-equivalence %s | FileCheck %s
diff --git a/test/tools/llvm-cov/copy_block_helper.m b/test/tools/llvm-cov/copy_block_helper.m
index 64973f1..d8202d0 100644
--- a/test/tools/llvm-cov/copy_block_helper.m
+++ b/test/tools/llvm-cov/copy_block_helper.m
@@ -9,7 +9,7 @@
// RUN: cd %t
// RUN: cp %s %p/Inputs/copy_block_helper.gc* .
-// RUN: llvm-cov copy_block_helper.m | FileCheck %s --check-prefix=STDOUT
+// RUN: llvm-cov gcov copy_block_helper.m | FileCheck %s --check-prefix=STDOUT
// STDOUT: File 'copy_block_helper.m'
// STDOUT: Lines executed:100.00% of 5
// STDOUT: copy_block_helper.m:creating 'copy_block_helper.m.gcov'
diff --git a/test/tools/llvm-cov/lit.local.cfg b/test/tools/llvm-cov/lit.local.cfg
index 650bc02..05aef86 100644
--- a/test/tools/llvm-cov/lit.local.cfg
+++ b/test/tools/llvm-cov/lit.local.cfg
@@ -1,5 +1 @@
-config.suffixes = ['.test', '.m', '.cpp']
-
-# http://llvm.org/bugs/show_bug.cgi?id=20979
-if 'ubsan' in config.available_features:
- config.unsupported = True
+config.suffixes = ['.test', '.m', '.cpp', '.c']
diff --git a/test/tools/llvm-cov/llvm-cov.test b/test/tools/llvm-cov/llvm-cov.test
index 0d3eb6b..ba5e18a 100644
--- a/test/tools/llvm-cov/llvm-cov.test
+++ b/test/tools/llvm-cov/llvm-cov.test
@@ -1,7 +1,8 @@
# Tests for compatibility between llvm-cov and gcov. These work by
# comparing llvm-cov against reference outputs generated by gcov 4.2.
-# "cd" and globbing are unsupported in lit internal runner.
+# Test fails on Windows where internal shell is used due to path separator
+# mismatches.
REQUIRES: shell
RUN: rm -rf %t
@@ -10,70 +11,70 @@ RUN: cd %t
RUN: cp %p/Inputs/test* .
# Basic behaviour with no flags
-RUN: llvm-cov test.c | diff -u test_no_options.output -
+RUN: llvm-cov gcov test.c | diff -u test_no_options.output -
RUN: diff -aub test_no_options.cpp.gcov test.cpp.gcov
RUN: diff -aub test_no_options.h.gcov test.h.gcov
# Same, but specifying the object directory
RUN: mkdir -p %t/objdir
RUN: cp test.gcno test.gcda %t/objdir
-RUN: llvm-cov -o objdir test.c | diff -u test_no_options.output -
+RUN: llvm-cov gcov -o objdir test.c | diff -u test_no_options.output -
RUN: diff -aub test_objdir.cpp.gcov test.cpp.gcov
RUN: diff -aub test_objdir.h.gcov test.h.gcov
# Specifying an object file
-RUN: llvm-cov -o objdir/test.o test.c | diff -u test_no_options.output -
+RUN: llvm-cov gcov -o objdir/test.o test.c | diff -u test_no_options.output -
RUN: diff -aub test_objdir.cpp.gcov test.cpp.gcov
RUN: diff -aub test_objdir.h.gcov test.h.gcov
# Specifying an object file that could be ambiguous with a directory
-RUN: llvm-cov -o objdir/test test.c | diff -u test_no_options.output -
+RUN: llvm-cov gcov -o objdir/test test.c | diff -u test_no_options.output -
RUN: diff -aub test_objdir.cpp.gcov test.cpp.gcov
RUN: diff -aub test_objdir.h.gcov test.h.gcov
# With gcov output disabled
-RUN: llvm-cov -n test.c | diff -u test_no_output.output -
+RUN: llvm-cov gcov -n test.c | diff -u test_no_output.output -
# Missing source files. This test is fragile, as it depends on being
# run before we copy some sources into place in the next test.
-RUN: llvm-cov test_paths.cpp 2>/dev/null | diff -u test_missing.output -
+RUN: llvm-cov gcov test_paths.cpp 2>/dev/null | diff -u test_missing.output -
RUN: diff -aub test_missing.cpp.gcov test.cpp.gcov
RUN: diff -aub test_missing.h.gcov test.h.gcov
# Preserve paths. This mangles the output filenames.
RUN: mkdir -p %t/srcdir/nested_dir
RUN: cp test.cpp test.h %t/srcdir
-RUN: llvm-cov -p test_paths.cpp | diff -u test_preserve_paths.output -
+RUN: llvm-cov gcov -p test_paths.cpp | diff -u test_preserve_paths.output -
RUN: diff -aub test_paths.cpp.gcov srcdir#nested_dir#^#test.cpp.gcov
RUN: diff -aub test_paths.h.gcov srcdir#nested_dir#^#test.h.gcov
# Don't preserve paths. Same results as preserve paths, but no mangling.
-RUN: llvm-cov test_paths.cpp | diff -u test_no_preserve_paths.output -
+RUN: llvm-cov gcov test_paths.cpp | diff -u test_no_preserve_paths.output -
RUN: diff -aub test_paths.cpp.gcov test.cpp.gcov
RUN: diff -aub test_paths.h.gcov test.h.gcov
# Long file names.
-RUN: llvm-cov -l test_paths.cpp | diff -u test_long_file_names.output -
+RUN: llvm-cov gcov -l test_paths.cpp | diff -u test_long_file_names.output -
RUN: diff -aub test_paths.cpp.gcov test_paths.cpp##test.cpp.gcov
RUN: diff -aub test_paths.h.gcov test_paths.cpp##test.h.gcov
# Long file names and preserve paths.
-RUN: llvm-cov -lp -gcno test_paths.gcno -gcda test_paths.gcda srcdir/../test_paths.cpp | diff -u test_long_paths.output -
+RUN: llvm-cov gcov -lp -gcno test_paths.gcno -gcda test_paths.gcda srcdir/../test_paths.cpp | diff -u test_long_paths.output -
RUN: diff -aub test_paths.cpp.gcov srcdir#^#test_paths.cpp##srcdir#nested_dir#^#test.cpp.gcov
RUN: diff -aub test_paths.h.gcov srcdir#^#test_paths.cpp##srcdir#nested_dir#^#test.h.gcov
# Function summaries. This changes stdout, but not the gcov files.
-RUN: llvm-cov test.c -f | diff -u test_-f.output -
+RUN: llvm-cov gcov test.c -f | diff -u test_-f.output -
RUN: diff -aub test_no_options.cpp.gcov test.cpp.gcov
RUN: diff -aub test_no_options.h.gcov test.h.gcov
# All blocks. This doesn't affect stdout, only the gcov files.
-RUN: llvm-cov test.c -a | diff -u test_no_options.output -
+RUN: llvm-cov gcov test.c -a | diff -u test_no_options.output -
RUN: diff -aub test_-a.cpp.gcov test.cpp.gcov
RUN: diff -aub test_-a.h.gcov test.h.gcov
# Branch probabilities.
-RUN: llvm-cov test.c -a -b | diff -u test_-b.output -
+RUN: llvm-cov gcov test.c -a -b | diff -u test_-b.output -
RUN: diff -aub test_-a_-b.cpp.gcov test.cpp.gcov
RUN: diff -aub test_-a_-b.h.gcov test.h.gcov
@@ -82,32 +83,36 @@ RUN: diff -aub test_-a_-b.h.gcov test.h.gcov
# FIXME: We don't correctly handle calls when -b and -f are used
# together, so our output differs from gcov. Remove the 'not' from
# this test once this is fixed.
-RUN: llvm-cov test.c -a -b -f | not diff -u test_-b_-f.output - >/dev/null
+RUN: llvm-cov gcov test.c -a -b -f | not diff -u test_-b_-f.output - >/dev/null
RUN: diff -aub test_-a_-b.cpp.gcov test.cpp.gcov
RUN: diff -aub test_-a_-b.h.gcov test.h.gcov
# Summarize unconditional branches too.
-RUN: llvm-cov test.c -a -b -u | diff -u test_-b.output -
+RUN: llvm-cov gcov test.c -a -b -u | diff -u test_-b.output -
RUN: diff -aub test_-a_-b_-u.cpp.gcov test.cpp.gcov
RUN: diff -aub test_-a_-b_-u.h.gcov test.h.gcov
# Absolute counts for branches.
-RUN: llvm-cov test.c -a -b -c -u | diff -u test_-b.output -
+RUN: llvm-cov gcov test.c -a -b -c -u | diff -u test_-b.output -
RUN: diff -aub test_-a_-b_-c_-u.cpp.gcov test.cpp.gcov
RUN: diff -aub test_-a_-b_-c_-u.h.gcov test.h.gcov
# Missing gcda file just gives 0 counts.
-RUN: llvm-cov test.c -gcda=no_such_gcda_file | diff -u test_no_gcda.output -
+RUN: llvm-cov gcov test.c -gcda=no_such_gcda_file | diff -u test_no_gcda.output -
RUN: diff -aub test_no_gcda.cpp.gcov test.cpp.gcov
RUN: diff -aub test_no_gcda.h.gcov test.h.gcov
# Invalid gcno file.
-RUN: llvm-cov test.c -gcno=test_read_fail.gcno
+RUN: llvm-cov gcov test.c -gcno=test_read_fail.gcno
# Bad file checksum on gcda.
-RUN: llvm-cov test.c -gcda=test_file_checksum_fail.gcda
+RUN: llvm-cov gcov test.c -gcda=test_file_checksum_fail.gcda
# Bad function checksum on gcda
-RUN: llvm-cov test.c -gcda=test_func_checksum_fail.gcda
+RUN: llvm-cov gcov test.c -gcda=test_func_checksum_fail.gcda
+
+# Has arcs from exit blocks
+RUN: llvm-cov gcov test_exit_block_arcs.c 2>&1 | FileCheck %s -check-prefix=EXIT_BLOCK_ARCS
+EXIT_BLOCK_ARCS: (main) has arcs from exit block.
XFAIL: powerpc64-, s390x, mips-, mips64-, sparc
diff --git a/test/tools/llvm-cov/range_based_for.cpp b/test/tools/llvm-cov/range_based_for.cpp
index 3fdb244..6f7a11a 100644
--- a/test/tools/llvm-cov/range_based_for.cpp
+++ b/test/tools/llvm-cov/range_based_for.cpp
@@ -9,7 +9,7 @@
// RUN: cd %t
// RUN: cp %s %p/Inputs/range_based_for.gc* .
-// RUN: llvm-cov range_based_for.cpp | FileCheck %s --check-prefix=STDOUT
+// RUN: llvm-cov gcov range_based_for.cpp | FileCheck %s --check-prefix=STDOUT
// STDOUT: File 'range_based_for.cpp'
// STDOUT: Lines executed:100.00% of 5
// STDOUT: range_based_for.cpp:creating 'range_based_for.cpp.gcov'
diff --git a/test/tools/llvm-cov/report.cpp b/test/tools/llvm-cov/report.cpp
index 570012e..3322e1a 100644
--- a/test/tools/llvm-cov/report.cpp
+++ b/test/tools/llvm-cov/report.cpp
@@ -1,5 +1,5 @@
-// RUN: llvm-cov report %S/Inputs/report.covmapping -instr-profile %S/Inputs/report.profdata -no-colors -filename-equivalence 2>&1 | FileCheck %s
-// RUN: llvm-cov report %S/Inputs/report.covmapping -instr-profile %S/Inputs/report.profdata -no-colors -filename-equivalence report.cpp 2>&1 | FileCheck -check-prefix=FILT-NEXT %s
+// RUN: llvm-cov report %S/Inputs/report.covmapping -instr-profile %S/Inputs/report.profdata -filename-equivalence 2>&1 | FileCheck %s
+// RUN: llvm-cov report %S/Inputs/report.covmapping -instr-profile %S/Inputs/report.profdata -filename-equivalence report.cpp 2>&1 | FileCheck -check-prefix=FILT-NEXT %s
// CHECK: Filename Regions Miss Cover Functions Executed
// CHECK-NEXT: ---
@@ -33,6 +33,3 @@ int main() {
bar();
return 0;
}
-
-// llvm-cov doesn't work on big endian yet
-// XFAIL: powerpc64-, s390x, mips-, mips64-, sparc
diff --git a/test/tools/llvm-cov/showExpansions.cpp b/test/tools/llvm-cov/showExpansions.cpp
index 30edd90..de3898f 100644
--- a/test/tools/llvm-cov/showExpansions.cpp
+++ b/test/tools/llvm-cov/showExpansions.cpp
@@ -24,6 +24,3 @@ int main(int argc, const char *argv[]) {
DO_SOMETHING(i); // CHECK-DAG: Expansion at line [[@LINE]], 5 -> 17
return 0;
}
-
-// llvm-cov doesn't work on big endian yet
-// XFAIL: powerpc64-, s390x, mips-, mips64-, sparc
diff --git a/test/tools/llvm-cov/showHighlightedRanges.cpp b/test/tools/llvm-cov/showHighlightedRanges.cpp
index 1ff7929..b5209d4 100644
--- a/test/tools/llvm-cov/showHighlightedRanges.cpp
+++ b/test/tools/llvm-cov/showHighlightedRanges.cpp
@@ -43,6 +43,3 @@ int main() {
func2(9);
return 0;
}
-
-// llvm-cov doesn't work on big endian yet
-// XFAIL: powerpc64-, s390x, mips-, mips64-, sparc
diff --git a/test/tools/llvm-cov/showLineExecutionCounts.cpp b/test/tools/llvm-cov/showLineExecutionCounts.cpp
index 625c3f2..d5254da 100644
--- a/test/tools/llvm-cov/showLineExecutionCounts.cpp
+++ b/test/tools/llvm-cov/showLineExecutionCounts.cpp
@@ -1,5 +1,5 @@
-// RUN: llvm-cov show %S/Inputs/lineExecutionCounts.covmapping -instr-profile %S/Inputs/lineExecutionCounts.profdata -no-colors -filename-equivalence %s | FileCheck -check-prefix=CHECK -check-prefix=WHOLE-FILE %s
-// RUN: llvm-cov show %S/Inputs/lineExecutionCounts.covmapping -instr-profile %S/Inputs/lineExecutionCounts.profdata -no-colors -filename-equivalence -name=main %s | FileCheck -check-prefix=CHECK -check-prefix=FILTER %s
+// Basic handling of line counts.
+// RUN: llvm-profdata merge %S/Inputs/lineExecutionCounts.proftext -o %t.profdata
// before any coverage // WHOLE-FILE: | [[@LINE]]|// before
// FILTER-NOT: | [[@LINE-1]]|// before
@@ -26,5 +26,5 @@ int main() { // CHECK: 1| [[@LINE]]|int main(
// after coverage // WHOLE-FILE: | [[@LINE]]|// after
// FILTER-NOT: | [[@LINE-1]]|// after
-// llvm-cov doesn't work on big endian yet
-// XFAIL: powerpc64-, s390x, mips-, mips64-, sparc
+// RUN: llvm-cov show %S/Inputs/lineExecutionCounts.covmapping -instr-profile %t.profdata -filename-equivalence %s | FileCheck -check-prefix=CHECK -check-prefix=WHOLE-FILE %s
+// RUN: llvm-cov show %S/Inputs/lineExecutionCounts.covmapping -instr-profile %t.profdata -filename-equivalence -name=main %s | FileCheck -check-prefix=CHECK -check-prefix=FILTER %s
diff --git a/test/tools/llvm-cov/showRegionMarkers.cpp b/test/tools/llvm-cov/showRegionMarkers.cpp
index 136c3bf..d1b83d2 100644
--- a/test/tools/llvm-cov/showRegionMarkers.cpp
+++ b/test/tools/llvm-cov/showRegionMarkers.cpp
@@ -1,4 +1,4 @@
-// RUN: llvm-cov show %S/Inputs/regionMarkers.covmapping -instr-profile %S/Inputs/regionMarkers.profdata -show-regions -dump -filename-equivalence %s 2>&1 | FileCheck %s
+// RUN: llvm-profdata merge %S/Inputs/regionMarkers.proftext -o %t.profdata
int main() { // CHECK: Marker at [[@LINE]]:12 = 1
int x = 0;
@@ -22,5 +22,4 @@ int main() { // CHECK: Marker at [[@LINE]]:12 = 1
return 0;
}
-// llvm-cov doesn't work on big endian yet
-// XFAIL: powerpc64-, s390x, mips-, mips64-, sparc
+// RUN: llvm-cov show %S/Inputs/regionMarkers.covmapping -instr-profile %t.profdata -show-regions -dump -filename-equivalence %s 2>&1 | FileCheck %s
diff --git a/test/tools/llvm-cov/showTemplateInstantiations.cpp b/test/tools/llvm-cov/showTemplateInstantiations.cpp
index 2b72d83..a9be473 100644
--- a/test/tools/llvm-cov/showTemplateInstantiations.cpp
+++ b/test/tools/llvm-cov/showTemplateInstantiations.cpp
@@ -1,5 +1,5 @@
-// RUN: llvm-cov show %S/Inputs/templateInstantiations.covmapping -instr-profile %S/Inputs/templateInstantiations.profdata -no-colors -filename-equivalence %s | FileCheck -check-prefix=CHECK -check-prefix=ALL %s
-// RUN: llvm-cov show %S/Inputs/templateInstantiations.covmapping -instr-profile %S/Inputs/templateInstantiations.profdata -no-colors -filename-equivalence -name=_Z4funcIbEiT_ %s | FileCheck -check-prefix=CHECK -check-prefix=FILTER %s
+// RUN: llvm-cov show %S/Inputs/templateInstantiations.covmapping -instr-profile %S/Inputs/templateInstantiations.profdata -filename-equivalence %s | FileCheck -check-prefix=CHECK -check-prefix=ALL %s
+// RUN: llvm-cov show %S/Inputs/templateInstantiations.covmapping -instr-profile %S/Inputs/templateInstantiations.profdata -filename-equivalence -name=_Z4funcIbEiT_ %s | FileCheck -check-prefix=CHECK -check-prefix=FILTER %s
// before coverage // WHOLE-FILE: | [[@LINE]]|// before
// FILTER-NOT: | [[@LINE-1]]|// before
@@ -38,6 +38,3 @@ int main() { // ALL: 1| [[@LINE]]|int main() {
} // ALL-NEXT: 1| [[@LINE]]|}
// after coverage // ALL-NEXT: | [[@LINE]]|// after
// FILTER-NOT: | [[@LINE-1]]|// after
-
-// llvm-cov doesn't work on big endian yet
-// XFAIL: powerpc64-, s390x, mips-, mips64-, sparc
diff --git a/test/tools/llvm-cov/universal-binary.c b/test/tools/llvm-cov/universal-binary.c
new file mode 100644
index 0000000..8ff94d4
--- /dev/null
+++ b/test/tools/llvm-cov/universal-binary.c
@@ -0,0 +1,10 @@
+// The coverage reader should be able to handle universal binaries
+
+// CHECK: 100| [[@LINE+1]]|int main
+int main(int argc, const char *argv[]) {}
+
+// RUN: llvm-profdata merge %S/Inputs/universal-binary.proftext -o %t.profdata
+// RUN: llvm-cov show %S/Inputs/universal-binary -instr-profile %t.profdata -filename-equivalence %s -arch x86_64 | FileCheck %s
+
+// RUN: not llvm-cov show %S/Inputs/universal-binary -instr-profile %t.profdata -filename-equivalence %s -arch i386 2>&1 | FileCheck --check-prefix=WRONG-ARCH %s
+// WRONG-ARCH: Failed to load coverage
diff --git a/test/tools/llvm-cxxdump/Inputs/eh.obj.coff-i386 b/test/tools/llvm-cxxdump/Inputs/eh.obj.coff-i386
new file mode 100644
index 0000000..f34a079
--- /dev/null
+++ b/test/tools/llvm-cxxdump/Inputs/eh.obj.coff-i386
Binary files differ
diff --git a/test/tools/llvm-vtabledump/Inputs/trivial.obj.coff-i386 b/test/tools/llvm-cxxdump/Inputs/trivial.obj.coff-i386
index 3b93955..3b93955 100644
--- a/test/tools/llvm-vtabledump/Inputs/trivial.obj.coff-i386
+++ b/test/tools/llvm-cxxdump/Inputs/trivial.obj.coff-i386
Binary files differ
diff --git a/test/tools/llvm-vtabledump/Inputs/trivial.obj.elf-i386 b/test/tools/llvm-cxxdump/Inputs/trivial.obj.elf-i386
index 1a5c929..1a5c929 100644
--- a/test/tools/llvm-vtabledump/Inputs/trivial.obj.elf-i386
+++ b/test/tools/llvm-cxxdump/Inputs/trivial.obj.elf-i386
Binary files differ
diff --git a/test/tools/llvm-cxxdump/eh.test b/test/tools/llvm-cxxdump/eh.test
new file mode 100644
index 0000000..b323b05
--- /dev/null
+++ b/test/tools/llvm-cxxdump/eh.test
@@ -0,0 +1,258 @@
+RUN: llvm-cxxdump %p/Inputs/eh.obj.coff-i386 \
+RUN: | FileCheck %s --check-prefix=COFF-I386
+
+
+COFF-I386: ??_R0?AUA@@@8[VFPtr]: ??_7type_info@@6B@
+COFF-I386: ??_R0?AUA@@@8[AlwaysZero]: 0
+COFF-I386: ??_R0?AUA@@@8[MangledName]: .?AUA@@
+COFF-I386: ??_R0?AUB@@@8[VFPtr]: ??_7type_info@@6B@
+COFF-I386: ??_R0?AUB@@@8[AlwaysZero]: 0
+COFF-I386: ??_R0?AUB@@@8[MangledName]: .?AUB@@
+COFF-I386: ??_R0?AUC@@@8[VFPtr]: ??_7type_info@@6B@
+COFF-I386: ??_R0?AUC@@@8[AlwaysZero]: 0
+COFF-I386: ??_R0?AUC@@@8[MangledName]: .?AUC@@
+COFF-I386: ??_R0?AUM@@@8[VFPtr]: ??_7type_info@@6B@
+COFF-I386: ??_R0?AUM@@@8[AlwaysZero]: 0
+COFF-I386: ??_R0?AUM@@@8[MangledName]: .?AUM@@
+COFF-I386: ??_R0?AUS@@@8[VFPtr]: ??_7type_info@@6B@
+COFF-I386: ??_R0?AUS@@@8[AlwaysZero]: 0
+COFF-I386: ??_R0?AUS@@@8[MangledName]: .?AUS@@
+COFF-I386: ??_R0?AW4E@@@8[VFPtr]: ??_7type_info@@6B@
+COFF-I386: ??_R0?AW4E@@@8[AlwaysZero]: 0
+COFF-I386: ??_R0?AW4E@@@8[MangledName]: .?AW4E@@
+COFF-I386: ??_R0PAUA@@@8[VFPtr]: ??_7type_info@@6B@
+COFF-I386: ??_R0PAUA@@@8[AlwaysZero]: 0
+COFF-I386: ??_R0PAUA@@@8[MangledName]: .PAUA@@
+COFF-I386: ??_R0PAUC@@@8[VFPtr]: ??_7type_info@@6B@
+COFF-I386: ??_R0PAUC@@@8[AlwaysZero]: 0
+COFF-I386: ??_R0PAUC@@@8[MangledName]: .PAUC@@
+COFF-I386: ??_R0PAUS@@@8[VFPtr]: ??_7type_info@@6B@
+COFF-I386: ??_R0PAUS@@@8[AlwaysZero]: 0
+COFF-I386: ??_R0PAUS@@@8[MangledName]: .PAUS@@
+COFF-I386: ??_R0PAW4E@@@8[VFPtr]: ??_7type_info@@6B@
+COFF-I386: ??_R0PAW4E@@@8[AlwaysZero]: 0
+COFF-I386: ??_R0PAW4E@@@8[MangledName]: .PAW4E@@
+COFF-I386: ??_R0PAX@8[VFPtr]: ??_7type_info@@6B@
+COFF-I386: ??_R0PAX@8[AlwaysZero]: 0
+COFF-I386: ??_R0PAX@8[MangledName]: .PAX
+COFF-I386: ??_R0PQS@@H@8[VFPtr]: ??_7type_info@@6B@
+COFF-I386: ??_R0PQS@@H@8[AlwaysZero]: 0
+COFF-I386: ??_R0PQS@@H@8[MangledName]: .PQS@@H
+COFF-I386: __TI1?AW4E@@[Flags]: 0
+COFF-I386: __TI1?AW4E@@[Flags.Const]: false
+COFF-I386: __TI1?AW4E@@[Flags.Volatile]: false
+COFF-I386: __TI1?AW4E@@[CleanupFn]: null
+COFF-I386: __TI1?AW4E@@[ForwardCompat]: null
+COFF-I386: __TI1?AW4E@@[CatchableTypeArray]: __CTA1?AW4E@@
+COFF-I386: __TI1PQS@@H[Flags]: 0
+COFF-I386: __TI1PQS@@H[Flags.Const]: false
+COFF-I386: __TI1PQS@@H[Flags.Volatile]: false
+COFF-I386: __TI1PQS@@H[CleanupFn]: null
+COFF-I386: __TI1PQS@@H[ForwardCompat]: null
+COFF-I386: __TI1PQS@@H[CatchableTypeArray]: __CTA1PQS@@H
+COFF-I386: __TI2CPAW4E@@[Flags]: 1
+COFF-I386: __TI2CPAW4E@@[Flags.Const]: true
+COFF-I386: __TI2CPAW4E@@[Flags.Volatile]: false
+COFF-I386: __TI2CPAW4E@@[CleanupFn]: null
+COFF-I386: __TI2CPAW4E@@[ForwardCompat]: null
+COFF-I386: __TI2CPAW4E@@[CatchableTypeArray]: __CTA2PAW4E@@
+COFF-I386: __TI2CVPAW4E@@[Flags]: 3
+COFF-I386: __TI2CVPAW4E@@[Flags.Const]: true
+COFF-I386: __TI2CVPAW4E@@[Flags.Volatile]: true
+COFF-I386: __TI2CVPAW4E@@[CleanupFn]: null
+COFF-I386: __TI2CVPAW4E@@[ForwardCompat]: null
+COFF-I386: __TI2CVPAW4E@@[CatchableTypeArray]: __CTA2PAW4E@@
+COFF-I386: __TI2PAW4E@@[Flags]: 0
+COFF-I386: __TI2PAW4E@@[Flags.Const]: false
+COFF-I386: __TI2PAW4E@@[Flags.Volatile]: false
+COFF-I386: __TI2PAW4E@@[CleanupFn]: null
+COFF-I386: __TI2PAW4E@@[ForwardCompat]: null
+COFF-I386: __TI2PAW4E@@[CatchableTypeArray]: __CTA2PAW4E@@
+COFF-I386: __TI2PAX[Flags]: 0
+COFF-I386: __TI2PAX[Flags.Const]: false
+COFF-I386: __TI2PAX[Flags.Volatile]: false
+COFF-I386: __TI2PAX[CleanupFn]: null
+COFF-I386: __TI2PAX[ForwardCompat]: null
+COFF-I386: __TI2PAX[CatchableTypeArray]: __CTA2PAX
+COFF-I386: __TI2VPAW4E@@[Flags]: 2
+COFF-I386: __TI2VPAW4E@@[Flags.Const]: false
+COFF-I386: __TI2VPAW4E@@[Flags.Volatile]: true
+COFF-I386: __TI2VPAW4E@@[CleanupFn]: null
+COFF-I386: __TI2VPAW4E@@[ForwardCompat]: null
+COFF-I386: __TI2VPAW4E@@[CatchableTypeArray]: __CTA2PAW4E@@
+COFF-I386: __TI3?AUM@@[Flags]: 0
+COFF-I386: __TI3?AUM@@[Flags.Const]: false
+COFF-I386: __TI3?AUM@@[Flags.Volatile]: false
+COFF-I386: __TI3?AUM@@[CleanupFn]: null
+COFF-I386: __TI3?AUM@@[ForwardCompat]: null
+COFF-I386: __TI3?AUM@@[CatchableTypeArray]: __CTA3?AUM@@
+COFF-I386: __TI3?AUS@@[Flags]: 0
+COFF-I386: __TI3?AUS@@[Flags.Const]: false
+COFF-I386: __TI3?AUS@@[Flags.Volatile]: false
+COFF-I386: __TI3?AUS@@[CleanupFn]: ??1S@@UAE@XZ
+COFF-I386: __TI3?AUS@@[ForwardCompat]: null
+COFF-I386: __TI3?AUS@@[CatchableTypeArray]: __CTA3?AUS@@
+COFF-I386: __TI4CPAUS@@[Flags]: 1
+COFF-I386: __TI4CPAUS@@[Flags.Const]: true
+COFF-I386: __TI4CPAUS@@[Flags.Volatile]: false
+COFF-I386: __TI4CPAUS@@[CleanupFn]: null
+COFF-I386: __TI4CPAUS@@[ForwardCompat]: null
+COFF-I386: __TI4CPAUS@@[CatchableTypeArray]: __CTA4PAUS@@
+COFF-I386: __TI4CVPAUS@@[Flags]: 3
+COFF-I386: __TI4CVPAUS@@[Flags.Const]: true
+COFF-I386: __TI4CVPAUS@@[Flags.Volatile]: true
+COFF-I386: __TI4CVPAUS@@[CleanupFn]: null
+COFF-I386: __TI4CVPAUS@@[ForwardCompat]: null
+COFF-I386: __TI4CVPAUS@@[CatchableTypeArray]: __CTA4PAUS@@
+COFF-I386: __TI4PAUS@@[Flags]: 0
+COFF-I386: __TI4PAUS@@[Flags.Const]: false
+COFF-I386: __TI4PAUS@@[Flags.Volatile]: false
+COFF-I386: __TI4PAUS@@[CleanupFn]: null
+COFF-I386: __TI4PAUS@@[ForwardCompat]: null
+COFF-I386: __TI4PAUS@@[CatchableTypeArray]: __CTA4PAUS@@
+COFF-I386: __TI4VPAUS@@[Flags]: 2
+COFF-I386: __TI4VPAUS@@[Flags.Const]: false
+COFF-I386: __TI4VPAUS@@[Flags.Volatile]: true
+COFF-I386: __TI4VPAUS@@[CleanupFn]: null
+COFF-I386: __TI4VPAUS@@[ForwardCompat]: null
+COFF-I386: __TI4VPAUS@@[CatchableTypeArray]: __CTA4PAUS@@
+COFF-I386: __CTA1?AW4E@@[NumEntries]: 1
+COFF-I386: __CTA1?AW4E@@[0]: __CT??_R0?AW4E@@@84
+COFF-I386: __CTA1PQS@@H[NumEntries]: 1
+COFF-I386: __CTA1PQS@@H[0]: __CT??_R0PQS@@H@88
+COFF-I386: __CTA2PAW4E@@[NumEntries]: 2
+COFF-I386: __CTA2PAW4E@@[0]: __CT??_R0PAW4E@@@84
+COFF-I386: __CTA2PAW4E@@[1]: __CT??_R0PAX@84
+COFF-I386: __CTA2PAX[NumEntries]: 2
+COFF-I386: __CTA2PAX[0]: __CT??_R0PAX@84
+COFF-I386: __CTA2PAX[1]: __CT??_R0PAX@84
+COFF-I386: __CTA3?AUM@@[NumEntries]: 3
+COFF-I386: __CTA3?AUM@@[0]: __CT??_R0?AUM@@@88
+COFF-I386: __CTA3?AUM@@[1]: __CT??_R0?AUA@@@84
+COFF-I386: __CTA3?AUM@@[2]: __CT??_R0?AUB@@@844
+COFF-I386: __CTA3?AUS@@[NumEntries]: 3
+COFF-I386: __CTA3?AUS@@[0]: __CT??_R0?AUS@@@8??0S@@QAE@ABU0@@Z16
+COFF-I386: __CTA3?AUS@@[1]: __CT??_R0?AUA@@@84044
+COFF-I386: __CTA3?AUS@@[2]: __CT??_R0?AUC@@@84048
+COFF-I386: __CTA4PAUS@@[NumEntries]: 4
+COFF-I386: __CTA4PAUS@@[0]: __CT??_R0PAUS@@@84
+COFF-I386: __CTA4PAUS@@[1]: __CT??_R0PAUA@@@84044
+COFF-I386: __CTA4PAUS@@[2]: __CT??_R0PAUC@@@84048
+COFF-I386: __CTA4PAUS@@[3]: __CT??_R0PAX@84
+COFF-I386: __CT??_R0?AUA@@@84[Flags]: 0
+COFF-I386: __CT??_R0?AUA@@@84[Flags.ScalarType]: false
+COFF-I386: __CT??_R0?AUA@@@84[Flags.VirtualInheritance]: false
+COFF-I386: __CT??_R0?AUA@@@84[TypeDescriptor]: ??_R0?AUA@@@8
+COFF-I386: __CT??_R0?AUA@@@84[NonVirtualBaseAdjustmentOffset]: 0
+COFF-I386: __CT??_R0?AUA@@@84[VirtualBasePointerOffset]: -1
+COFF-I386: __CT??_R0?AUA@@@84[VirtualBaseAdjustmentOffset]: 0
+COFF-I386: __CT??_R0?AUA@@@84[Size]: 4
+COFF-I386: __CT??_R0?AUA@@@84[CopyCtor]: null
+COFF-I386: __CT??_R0?AUA@@@84044[Flags]: 0
+COFF-I386: __CT??_R0?AUA@@@84044[Flags.ScalarType]: false
+COFF-I386: __CT??_R0?AUA@@@84044[Flags.VirtualInheritance]: false
+COFF-I386: __CT??_R0?AUA@@@84044[TypeDescriptor]: ??_R0?AUA@@@8
+COFF-I386: __CT??_R0?AUA@@@84044[NonVirtualBaseAdjustmentOffset]: 0
+COFF-I386: __CT??_R0?AUA@@@84044[VirtualBasePointerOffset]: 4
+COFF-I386: __CT??_R0?AUA@@@84044[VirtualBaseAdjustmentOffset]: 4
+COFF-I386: __CT??_R0?AUA@@@84044[Size]: 4
+COFF-I386: __CT??_R0?AUA@@@84044[CopyCtor]: null
+COFF-I386: __CT??_R0?AUB@@@844[Flags]: 0
+COFF-I386: __CT??_R0?AUB@@@844[Flags.ScalarType]: false
+COFF-I386: __CT??_R0?AUB@@@844[Flags.VirtualInheritance]: false
+COFF-I386: __CT??_R0?AUB@@@844[TypeDescriptor]: ??_R0?AUB@@@8
+COFF-I386: __CT??_R0?AUB@@@844[NonVirtualBaseAdjustmentOffset]: 4
+COFF-I386: __CT??_R0?AUB@@@844[VirtualBasePointerOffset]: -1
+COFF-I386: __CT??_R0?AUB@@@844[VirtualBaseAdjustmentOffset]: 0
+COFF-I386: __CT??_R0?AUB@@@844[Size]: 4
+COFF-I386: __CT??_R0?AUB@@@844[CopyCtor]: null
+COFF-I386: __CT??_R0?AUC@@@84048[Flags]: 0
+COFF-I386: __CT??_R0?AUC@@@84048[Flags.ScalarType]: false
+COFF-I386: __CT??_R0?AUC@@@84048[Flags.VirtualInheritance]: false
+COFF-I386: __CT??_R0?AUC@@@84048[TypeDescriptor]: ??_R0?AUC@@@8
+COFF-I386: __CT??_R0?AUC@@@84048[NonVirtualBaseAdjustmentOffset]: 0
+COFF-I386: __CT??_R0?AUC@@@84048[VirtualBasePointerOffset]: 4
+COFF-I386: __CT??_R0?AUC@@@84048[VirtualBaseAdjustmentOffset]: 8
+COFF-I386: __CT??_R0?AUC@@@84048[Size]: 4
+COFF-I386: __CT??_R0?AUC@@@84048[CopyCtor]: null
+COFF-I386: __CT??_R0?AUM@@@88[Flags]: 0
+COFF-I386: __CT??_R0?AUM@@@88[Flags.ScalarType]: false
+COFF-I386: __CT??_R0?AUM@@@88[Flags.VirtualInheritance]: false
+COFF-I386: __CT??_R0?AUM@@@88[TypeDescriptor]: ??_R0?AUM@@@8
+COFF-I386: __CT??_R0?AUM@@@88[NonVirtualBaseAdjustmentOffset]: 0
+COFF-I386: __CT??_R0?AUM@@@88[VirtualBasePointerOffset]: -1
+COFF-I386: __CT??_R0?AUM@@@88[VirtualBaseAdjustmentOffset]: 0
+COFF-I386: __CT??_R0?AUM@@@88[Size]: 8
+COFF-I386: __CT??_R0?AUM@@@88[CopyCtor]: null
+COFF-I386: __CT??_R0?AUS@@@8??0S@@QAE@ABU0@@Z16[Flags]: 4
+COFF-I386: __CT??_R0?AUS@@@8??0S@@QAE@ABU0@@Z16[Flags.ScalarType]: false
+COFF-I386: __CT??_R0?AUS@@@8??0S@@QAE@ABU0@@Z16[Flags.VirtualInheritance]: true
+COFF-I386: __CT??_R0?AUS@@@8??0S@@QAE@ABU0@@Z16[TypeDescriptor]: ??_R0?AUS@@@8
+COFF-I386: __CT??_R0?AUS@@@8??0S@@QAE@ABU0@@Z16[NonVirtualBaseAdjustmentOffset]: 0
+COFF-I386: __CT??_R0?AUS@@@8??0S@@QAE@ABU0@@Z16[VirtualBasePointerOffset]: -1
+COFF-I386: __CT??_R0?AUS@@@8??0S@@QAE@ABU0@@Z16[VirtualBaseAdjustmentOffset]: 0
+COFF-I386: __CT??_R0?AUS@@@8??0S@@QAE@ABU0@@Z16[Size]: 16
+COFF-I386: __CT??_R0?AUS@@@8??0S@@QAE@ABU0@@Z16[CopyCtor]: ??0S@@QAE@ABU0@@Z
+COFF-I386: __CT??_R0?AW4E@@@84[Flags]: 1
+COFF-I386: __CT??_R0?AW4E@@@84[Flags.ScalarType]: true
+COFF-I386: __CT??_R0?AW4E@@@84[Flags.VirtualInheritance]: false
+COFF-I386: __CT??_R0?AW4E@@@84[TypeDescriptor]: ??_R0?AW4E@@@8
+COFF-I386: __CT??_R0?AW4E@@@84[NonVirtualBaseAdjustmentOffset]: 0
+COFF-I386: __CT??_R0?AW4E@@@84[VirtualBasePointerOffset]: -1
+COFF-I386: __CT??_R0?AW4E@@@84[VirtualBaseAdjustmentOffset]: 0
+COFF-I386: __CT??_R0?AW4E@@@84[Size]: 4
+COFF-I386: __CT??_R0?AW4E@@@84[CopyCtor]: null
+COFF-I386: __CT??_R0PAUA@@@84044[Flags]: 1
+COFF-I386: __CT??_R0PAUA@@@84044[Flags.ScalarType]: true
+COFF-I386: __CT??_R0PAUA@@@84044[Flags.VirtualInheritance]: false
+COFF-I386: __CT??_R0PAUA@@@84044[TypeDescriptor]: ??_R0PAUA@@@8
+COFF-I386: __CT??_R0PAUA@@@84044[NonVirtualBaseAdjustmentOffset]: 0
+COFF-I386: __CT??_R0PAUA@@@84044[VirtualBasePointerOffset]: 4
+COFF-I386: __CT??_R0PAUA@@@84044[VirtualBaseAdjustmentOffset]: 4
+COFF-I386: __CT??_R0PAUA@@@84044[Size]: 4
+COFF-I386: __CT??_R0PAUA@@@84044[CopyCtor]: null
+COFF-I386: __CT??_R0PAUC@@@84048[Flags]: 1
+COFF-I386: __CT??_R0PAUC@@@84048[Flags.ScalarType]: true
+COFF-I386: __CT??_R0PAUC@@@84048[Flags.VirtualInheritance]: false
+COFF-I386: __CT??_R0PAUC@@@84048[TypeDescriptor]: ??_R0PAUC@@@8
+COFF-I386: __CT??_R0PAUC@@@84048[NonVirtualBaseAdjustmentOffset]: 0
+COFF-I386: __CT??_R0PAUC@@@84048[VirtualBasePointerOffset]: 4
+COFF-I386: __CT??_R0PAUC@@@84048[VirtualBaseAdjustmentOffset]: 8
+COFF-I386: __CT??_R0PAUC@@@84048[Size]: 4
+COFF-I386: __CT??_R0PAUC@@@84048[CopyCtor]: null
+COFF-I386: __CT??_R0PAUS@@@84[Flags]: 5
+COFF-I386: __CT??_R0PAUS@@@84[Flags.ScalarType]: true
+COFF-I386: __CT??_R0PAUS@@@84[Flags.VirtualInheritance]: true
+COFF-I386: __CT??_R0PAUS@@@84[TypeDescriptor]: ??_R0PAUS@@@8
+COFF-I386: __CT??_R0PAUS@@@84[NonVirtualBaseAdjustmentOffset]: 0
+COFF-I386: __CT??_R0PAUS@@@84[VirtualBasePointerOffset]: -1
+COFF-I386: __CT??_R0PAUS@@@84[VirtualBaseAdjustmentOffset]: 0
+COFF-I386: __CT??_R0PAUS@@@84[Size]: 4
+COFF-I386: __CT??_R0PAUS@@@84[CopyCtor]: null
+COFF-I386: __CT??_R0PAW4E@@@84[Flags]: 1
+COFF-I386: __CT??_R0PAW4E@@@84[Flags.ScalarType]: true
+COFF-I386: __CT??_R0PAW4E@@@84[Flags.VirtualInheritance]: false
+COFF-I386: __CT??_R0PAW4E@@@84[TypeDescriptor]: ??_R0PAW4E@@@8
+COFF-I386: __CT??_R0PAW4E@@@84[NonVirtualBaseAdjustmentOffset]: 0
+COFF-I386: __CT??_R0PAW4E@@@84[VirtualBasePointerOffset]: -1
+COFF-I386: __CT??_R0PAW4E@@@84[VirtualBaseAdjustmentOffset]: 0
+COFF-I386: __CT??_R0PAW4E@@@84[Size]: 4
+COFF-I386: __CT??_R0PAW4E@@@84[CopyCtor]: null
+COFF-I386: __CT??_R0PAX@84[Flags]: 1
+COFF-I386: __CT??_R0PAX@84[Flags.ScalarType]: true
+COFF-I386: __CT??_R0PAX@84[Flags.VirtualInheritance]: false
+COFF-I386: __CT??_R0PAX@84[TypeDescriptor]: ??_R0PAX@8
+COFF-I386: __CT??_R0PAX@84[NonVirtualBaseAdjustmentOffset]: 0
+COFF-I386: __CT??_R0PAX@84[VirtualBasePointerOffset]: -1
+COFF-I386: __CT??_R0PAX@84[VirtualBaseAdjustmentOffset]: 0
+COFF-I386: __CT??_R0PAX@84[Size]: 4
+COFF-I386: __CT??_R0PAX@84[CopyCtor]: null
+COFF-I386: __CT??_R0PQS@@H@88[Flags]: 1
+COFF-I386: __CT??_R0PQS@@H@88[Flags.ScalarType]: true
+COFF-I386: __CT??_R0PQS@@H@88[Flags.VirtualInheritance]: false
+COFF-I386: __CT??_R0PQS@@H@88[TypeDescriptor]: ??_R0PQS@@H@8
+COFF-I386: __CT??_R0PQS@@H@88[NonVirtualBaseAdjustmentOffset]: 0
+COFF-I386: __CT??_R0PQS@@H@88[VirtualBasePointerOffset]: -1
+COFF-I386: __CT??_R0PQS@@H@88[VirtualBaseAdjustmentOffset]: 0
+COFF-I386: __CT??_R0PQS@@H@88[Size]: 8
+COFF-I386: __CT??_R0PQS@@H@88[CopyCtor]: null
diff --git a/test/tools/llvm-vtabledump/trivial.test b/test/tools/llvm-cxxdump/trivial.test
index 92bd058..450ed3b 100644
--- a/test/tools/llvm-vtabledump/trivial.test
+++ b/test/tools/llvm-cxxdump/trivial.test
@@ -1,7 +1,7 @@
-RUN: llvm-vtabledump %p/Inputs/trivial.obj.coff-i386 \
+RUN: llvm-cxxdump %p/Inputs/trivial.obj.coff-i386 \
RUN: | FileCheck %s --check-prefix=COFF-I386
-RUN: llvm-vtabledump %p/Inputs/trivial.obj.elf-i386 \
+RUN: llvm-cxxdump %p/Inputs/trivial.obj.elf-i386 \
RUN: | FileCheck %s --check-prefix=ELF-I386
COFF-I386: ??_7S@@6B@[0]: ??_R4S@@6B@
diff --git a/test/tools/llvm-objdump/ARM/macho-data-in-code.test b/test/tools/llvm-objdump/ARM/macho-data-in-code.test
index 1814dc0..c7a6da1 100644
--- a/test/tools/llvm-objdump/ARM/macho-data-in-code.test
+++ b/test/tools/llvm-objdump/ARM/macho-data-in-code.test
@@ -1,4 +1,5 @@
RUN: llvm-objdump -m -data-in-code %p/Inputs/data-in-code.macho-arm | FileCheck %s
+RUN: llvm-objdump -m -data-in-code -non-verbose %p/Inputs/data-in-code.macho-arm | FileCheck %s -check-prefix=NON_VERBOSE
CHECK: Data in code table (4 entries)
CHECK: offset length kind
@@ -6,3 +7,10 @@ CHECK: 0x00000000 4 DATA
CHECK: 0x00000004 4 JUMP_TABLE32
CHECK: 0x00000008 2 JUMP_TABLE16
CHECK: 0x0000000a 1 JUMP_TABLE8
+
+NON_VERBOSE: Data in code table (4 entries)
+NON_VERBOSE: offset length kind
+NON_VERBOSE: 0x00000000 4 0x0001
+NON_VERBOSE: 0x00000004 4 0x0004
+NON_VERBOSE: 0x00000008 2 0x0003
+NON_VERBOSE: 0x0000000a 1 0x0002
diff --git a/test/tools/llvm-objdump/X86/macho-cstring-dump.test b/test/tools/llvm-objdump/X86/macho-cstring-dump.test
index 3dfa4e3..0e19f51 100644
--- a/test/tools/llvm-objdump/X86/macho-cstring-dump.test
+++ b/test/tools/llvm-objdump/X86/macho-cstring-dump.test
@@ -1,4 +1,13 @@
RUN: llvm-objdump -m -section __TEXT,__cstring %p/Inputs/hello.obj.macho-x86_64 | FileCheck %s
+RUN: llvm-objdump -m -section __TEXT,__cstring -no-leading-addr %p/Inputs/hello.obj.macho-x86_64 | FileCheck %s -check-prefix=NO_ADDR
+RUN: llvm-objdump -m -section __TEXT,__cstring -non-verbose %p/Inputs/hello.obj.macho-x86_64 | FileCheck %s -check-prefix=NON_VERBOSE
CHECK: Contents of (__TEXT,__cstring) section
CHECK: 000000000000003b Hello world\n
+
+NO_ADDR: Contents of (__TEXT,__cstring) section
+NO_ADDR: Hello world\n
+NO_ADDR-NOT: 000000000000003b
+
+NON_VERBOSE: Contents of (__TEXT,__cstring) section
+NON_VERBOSE: 000000000000003b 48 65 6c 6c 6f 20 77 6f 72 6c 64 0a 00
diff --git a/test/tools/llvm-objdump/X86/macho-dis-no-leading-addr.test b/test/tools/llvm-objdump/X86/macho-dis-no-leading-addr.test
new file mode 100644
index 0000000..df4618d
--- /dev/null
+++ b/test/tools/llvm-objdump/X86/macho-dis-no-leading-addr.test
@@ -0,0 +1,24 @@
+# RUN: llvm-objdump -m -d %p/Inputs/hello.obj.macho-x86_64 -no-show-raw-insn -print-imm-hex -no-leading-addr | FileCheck %s
+
+# CHECK: (__TEXT,__text) section
+# CHECK: _main:
+# CHECK: pushq %rbp
+# CHECK: movq %rsp, %rbp
+# CHECK: subq $0x20, %rsp
+# CHECK: leaq L_.str(%rip), %rax ## literal pool for: "Hello world\n"
+# CHECK: movl $_main, -0x4(%rbp)
+# CHECK: movl %edi, -0x8(%rbp)
+# CHECK: movq %rsi, -0x10(%rbp)
+# CHECK: movq %rdx, -0x18(%rbp)
+# CHECK: movq %rax, %rdi
+# CHECK: movb $0x0, %al
+# CHECK: callq _printf
+# CHECK: movl $_main, %ecx
+# CHECK: movl %eax, -0x1c(%rbp)
+# CHECK: movl %ecx, %eax
+# CHECK: addq $0x20, %rsp
+# CHECK: popq %rbp
+# CHECK: retq
+
+# CHECK-NOT: 0:
+# CHECK-NOT: 0000000000000000
diff --git a/test/tools/llvm-objdump/X86/macho-dis-symname.test b/test/tools/llvm-objdump/X86/macho-dis-symname.test
new file mode 100644
index 0000000..39d16ec
--- /dev/null
+++ b/test/tools/llvm-objdump/X86/macho-dis-symname.test
@@ -0,0 +1,19 @@
+# RUN: llvm-objdump -m -d %p/Inputs/exeThread.macho-x86_64 -dis-symname start -no-show-raw-insn -full-leading-addr -print-imm-hex | FileCheck %s
+
+# CHECK: (__TEXT,__text) section
+# CHECK: start:
+# CHECK: 0000000100000d00 pushq $0x0
+# CHECK: 0000000100000d02 movq %rsp, %rbp
+# CHECK: 0000000100000d05 andq $-0x10, %rsp
+# CHECK: 0000000100000d09 movq 0x8(%rbp), %rdi
+# CHECK: 0000000100000d0d leaq 0x10(%rbp), %rsi
+# CHECK: 0000000100000d11 movl %edi, %edx
+# CHECK: 0000000100000d13 addl $0x1, %edx
+# CHECK: 0000000100000d16 shll $0x3, %edx
+# CHECK: 0000000100000d19 addq %rsi, %rdx
+# CHECK: 0000000100000d1c callq __start
+# CHECK: 0000000100000d21 hlt
+
+# CHECK-NOT: __start:
+# CHECK-NOT: 0000000100000d22
+# CHECK-NOT: _main:
diff --git a/test/tools/llvm-objdump/X86/macho-dylib.test b/test/tools/llvm-objdump/X86/macho-dylib.test
new file mode 100644
index 0000000..0e31b8b
--- /dev/null
+++ b/test/tools/llvm-objdump/X86/macho-dylib.test
@@ -0,0 +1,6 @@
+RUN: llvm-objdump -m -dylibs-used %p/Inputs/hello.exe.macho-x86_64 | FileCheck %s -check-prefix=USED
+RUN: llvm-objdump -m -dylib-id %p/Inputs/dylibLoadKinds.macho-x86_64 | FileCheck %s -check-prefix=ID
+
+USED: /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)
+
+ID: /usr/lib/foo.dylib
diff --git a/test/tools/llvm-objdump/X86/macho-indirect-symbols.test b/test/tools/llvm-objdump/X86/macho-indirect-symbols.test
index 4f3af18..fdc465a 100644
--- a/test/tools/llvm-objdump/X86/macho-indirect-symbols.test
+++ b/test/tools/llvm-objdump/X86/macho-indirect-symbols.test
@@ -1,4 +1,5 @@
RUN: llvm-objdump -macho -indirect-symbols %p/Inputs/hello.exe.macho-x86_64 | FileCheck %s
+RUN: llvm-objdump -macho -indirect-symbols -non-verbose %p/Inputs/hello.exe.macho-x86_64 | FileCheck %s -check-prefix=NON_VERBOSE
CHECK: Indirect symbols for (__TEXT,__stubs) 1 entries
CHECK: address index name
@@ -10,3 +11,14 @@ CHECK: 0x0000000100001008 ABSOLUTE
CHECK: Indirect symbols for (__DATA,__la_symbol_ptr) 1 entries
CHECK: address index name
CHECK: 0x0000000100001010 2 _printf
+
+NON_VERBOSE: Indirect symbols for (__TEXT,__stubs) 1 entries
+NON_VERBOSE: address index
+NON_VERBOSE: 0x0000000100000f6c 2
+NON_VERBOSE: Indirect symbols for (__DATA,__nl_symbol_ptr) 2 entries
+NON_VERBOSE: address index
+NON_VERBOSE: 0x0000000100001000 3
+NON_VERBOSE: 0x0000000100001008 ABSOLUTE
+NON_VERBOSE: Indirect symbols for (__DATA,__la_symbol_ptr) 1 entries
+NON_VERBOSE: address index
+NON_VERBOSE: 0x0000000100001010 2
diff --git a/test/tools/llvm-objdump/X86/macho-info-plist.test b/test/tools/llvm-objdump/X86/macho-info-plist.test
new file mode 100644
index 0000000..bee1952
--- /dev/null
+++ b/test/tools/llvm-objdump/X86/macho-info-plist.test
@@ -0,0 +1,7 @@
+# RUN: llvm-mc < %s -triple x86_64-apple-darwin -filetype=obj | llvm-objdump -m -info-plist - | FileCheck %s
+
+.section __TEXT, __info_plist
+.asciz "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+
+# CHECK: Contents of (__TEXT,__info_plist) section
+# CHECK: <?xml version="1.0" encoding="UTF-8"?>
diff --git a/test/tools/llvm-objdump/X86/macho-literal-pointers-i386.test b/test/tools/llvm-objdump/X86/macho-literal-pointers-i386.test
index 0069668..62ed607 100644
--- a/test/tools/llvm-objdump/X86/macho-literal-pointers-i386.test
+++ b/test/tools/llvm-objdump/X86/macho-literal-pointers-i386.test
@@ -1,4 +1,5 @@
# RUN: llvm-mc < %s -triple i386-apple-darwin -filetype=obj | llvm-objdump -m -section __DATA,__litp - | FileCheck %s
+# RUN: llvm-mc < %s -triple i386-apple-darwin -filetype=obj | llvm-objdump -m -section __DATA,__litp -non-verbose - | FileCheck %s -check-prefix=NON-VERBOSE
.cstring
L1: .asciz "Hello world\n"
@@ -32,3 +33,7 @@ L5: .asciz "const non-literal string"
# CHECK: 00000054 __TEXT:__literal8:0x00000000 0x40200000
# CHECK: 00000058 __TEXT:__literal16:0x10000016 0x20000016 0x30000016 0x40000016
# CHECK: 0000005c 0x30 (not in a literal section)
+
+# NON-VERBOSE: Contents of (__DATA,__litp) section
+# NON-VERBOSE: 0000004c 00 00 00 00 10 00 00 00 18 00 00 00 20 00 00 00
+# NON-VERBOSE: 0000005c 30 00 00 00
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
index b403b81..f1912e8 100644
--- a/test/tools/llvm-objdump/X86/macho-literal-pointers-x86_64.test
+++ b/test/tools/llvm-objdump/X86/macho-literal-pointers-x86_64.test
@@ -1,4 +1,5 @@
# RUN: llvm-mc < %s -triple x86_64-apple-darwin -filetype=obj | llvm-objdump -m -section __DATA,__litp - | FileCheck %s
+# RUN: llvm-mc < %s -triple x86_64-apple-darwin -filetype=obj | llvm-objdump -m -section __DATA,__litp -non-verbose - | FileCheck %s -check-prefix=NON-VERBOSE
.cstring
L1: .asciz "Hello world\n"
@@ -32,3 +33,8 @@ L5: .asciz "const non-literal string"
# CHECK: 0000000000000060 __TEXT:__literal8:0x00000000 0x40200000
# CHECK: 0000000000000068 __TEXT:__literal16:0x10000016 0x20000016 0x30000016 0x40000016
# CHECK: 0000000000000070 0x30 (not in a literal section)
+
+# NON-VERBOSE: Contents of (__DATA,__litp) section
+# NON-VERBOSE: 0000000000000050 00 00 00 00 00 00 00 00 10 00 00 00 00 00 00 00
+# NON-VERBOSE: 0000000000000060 18 00 00 00 00 00 00 00 20 00 00 00 00 00 00 00
+# NON-VERBOSE: 0000000000000070 30 00 00 00 00 00 00 00
diff --git a/test/tools/llvm-objdump/X86/macho-literals.test b/test/tools/llvm-objdump/X86/macho-literals.test
index 4824453..d93ae67 100644
--- a/test/tools/llvm-objdump/X86/macho-literals.test
+++ b/test/tools/llvm-objdump/X86/macho-literals.test
@@ -1,6 +1,9 @@
# 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,__literal4 -non-verbose - | FileCheck %s -check-prefix=NON-VERBOSE-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,__literal8 -non-verbose - | FileCheck %s -check-prefix=NON-VERBOSE-LIT8
# RUN: llvm-mc < %s -triple x86_64-apple-darwin -filetype=obj | llvm-objdump -m -section __TEXT,__literal16 - | FileCheck %s -check-prefix=CHECK-LIT16
+# RUN: llvm-mc < %s -triple x86_64-apple-darwin -filetype=obj | llvm-objdump -m -section __TEXT,__literal16 -non-verbose - | FileCheck %s -check-prefix=NON-VERBOSE-LIT16
.literal4
.float 2.5
@@ -18,6 +21,10 @@
# CHECK-LIT4: 0000000000000010 0x7fc00000
# CHECK-LIT4: 0000000000000014 0x7f800001
+# NON-VERBOSE-LIT4: Contents of (__TEXT,__literal4) section
+# NON-VERBOSE-LIT4: 0000000000000000 00 00 20 40 00 00 04 41 00 00 80 7f 00 00 80 ff
+# NON-VERBOSE-LIT4: 0000000000000010 00 00 c0 7f 01 00 80 7f
+
.literal8
.double 2.5
.double 8.25
@@ -38,6 +45,11 @@
# CHECK-LIT8: 0000000000000038 0x00000000 0x7ff80000
# CHECK-LIT8: 0000000000000040 0x00000001 0x7ff00000
+# NON-VERBOSE-LIT8: Contents of (__TEXT,__literal8) section
+# NON-VERBOSE-LIT8: 0000000000000018 00 00 00 00 00 00 04 40 00 00 00 00 00 80 20 40
+# NON-VERBOSE-LIT8: 0000000000000028 00 00 00 00 00 00 f0 7f 00 00 00 00 00 00 f0 ff
+# NON-VERBOSE-LIT8: 0000000000000038 00 00 00 00 00 00 f8 7f 01 00 00 00 00 00 f0 7f
+
.literal16
.long 1
.long 2
@@ -46,3 +58,6 @@
# CHECK-LIT16: Contents of (__TEXT,__literal16) section
# CHECK-LIT16: 0000000000000050 0x00000001 0x00000002 0x00000003 0x00000004
+
+# NON-VERBOSE-LIT16: Contents of (__TEXT,__literal16) section
+# NON-VERBOSE-LIT16: 0000000000000050 01 00 00 00 02 00 00 00 03 00 00 00 04 00 00 00
diff --git a/test/tools/llvm-objdump/X86/macho-private-headers.test b/test/tools/llvm-objdump/X86/macho-private-headers.test
index c80bb08..ff45b18 100644
--- a/test/tools/llvm-objdump/X86/macho-private-headers.test
+++ b/test/tools/llvm-objdump/X86/macho-private-headers.test
@@ -19,6 +19,8 @@
// 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
+// RUN: llvm-objdump -p -non-verbose %p/Inputs/hello.obj.macho-x86_64 \
+// RUN: | FileCheck %s -check-prefix=NON_VERBOSE
CHECK: Mach header
CHECK: magic cputype cpusubtype caps filetype ncmds sizeofcmds flags
@@ -443,3 +445,95 @@ 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
+
+NON_VERBOSE: Mach header
+NON_VERBOSE: magic cputype cpusubtype caps filetype ncmds sizeofcmds flags
+NON_VERBOSE: 0xfeedfacf 16777223 3 0x00 1 3 496 0x00002000
+NON_VERBOSE: Load command 0
+NON_VERBOSE: cmd LC_SEGMENT_64
+NON_VERBOSE: cmdsize 392
+NON_VERBOSE: segname
+NON_VERBOSE: vmaddr 0x0000000000000000
+NON_VERBOSE: vmsize 0x00000000000000a8
+NON_VERBOSE: fileoff 528
+NON_VERBOSE: filesize 168
+NON_VERBOSE: maxprot 0x00000007
+NON_VERBOSE: initprot 0x00000007
+NON_VERBOSE: nsects 4
+NON_VERBOSE: flags 0x0
+NON_VERBOSE: Section
+NON_VERBOSE: sectname __text
+NON_VERBOSE: segname __TEXT
+NON_VERBOSE: addr 0x0000000000000000
+NON_VERBOSE: size 0x000000000000003b
+NON_VERBOSE: offset 528
+NON_VERBOSE: align 2^4 (16)
+NON_VERBOSE: reloff 696
+NON_VERBOSE: nreloc 2
+NON_VERBOSE: flags 0x80000400
+NON_VERBOSE: reserved1 0
+NON_VERBOSE: reserved2 0
+NON_VERBOSE: Section
+NON_VERBOSE: sectname __cstring
+NON_VERBOSE: segname __TEXT
+NON_VERBOSE: addr 0x000000000000003b
+NON_VERBOSE: size 0x000000000000000d
+NON_VERBOSE: offset 587
+NON_VERBOSE: align 2^0 (1)
+NON_VERBOSE: reloff 0
+NON_VERBOSE: nreloc 0
+NON_VERBOSE: flags 0x00000002
+NON_VERBOSE: reserved1 0
+NON_VERBOSE: reserved2 0
+NON_VERBOSE: Section
+NON_VERBOSE: sectname __compact_unwind
+NON_VERBOSE: segname __LD
+NON_VERBOSE: addr 0x0000000000000048
+NON_VERBOSE: size 0x0000000000000020
+NON_VERBOSE: offset 600
+NON_VERBOSE: align 2^3 (8)
+NON_VERBOSE: reloff 712
+NON_VERBOSE: nreloc 1
+NON_VERBOSE: flags 0x02000000
+NON_VERBOSE: reserved1 0
+NON_VERBOSE: reserved2 0
+NON_VERBOSE: Section
+NON_VERBOSE: sectname __eh_frame
+NON_VERBOSE: segname __TEXT
+NON_VERBOSE: addr 0x0000000000000068
+NON_VERBOSE: size 0x0000000000000040
+NON_VERBOSE: offset 632
+NON_VERBOSE: align 2^3 (8)
+NON_VERBOSE: reloff 0
+NON_VERBOSE: nreloc 0
+NON_VERBOSE: flags 0x6800000b
+NON_VERBOSE: reserved1 0
+NON_VERBOSE: reserved2 0
+NON_VERBOSE: Load command 1
+NON_VERBOSE: cmd LC_SYMTAB
+NON_VERBOSE: cmdsize 24
+NON_VERBOSE: symoff 720
+NON_VERBOSE: nsyms 5
+NON_VERBOSE: stroff 800
+NON_VERBOSE: strsize 44
+NON_VERBOSE: Load command 2
+NON_VERBOSE: cmd LC_DYSYMTAB
+NON_VERBOSE: cmdsize 80
+NON_VERBOSE: ilocalsym 0
+NON_VERBOSE: nlocalsym 2
+NON_VERBOSE: iextdefsym 2
+NON_VERBOSE: nextdefsym 2
+NON_VERBOSE: iundefsym 4
+NON_VERBOSE: nundefsym 1
+NON_VERBOSE: tocoff 0
+NON_VERBOSE: ntoc 0
+NON_VERBOSE: modtaboff 0
+NON_VERBOSE: nmodtab 0
+NON_VERBOSE: extrefsymoff 0
+NON_VERBOSE: nextrefsyms 0
+NON_VERBOSE: indirectsymoff 0
+NON_VERBOSE: nindirectsyms 0
+NON_VERBOSE: extreloff 0
+NON_VERBOSE: nextrel 0
+NON_VERBOSE: locreloff 0
+NON_VERBOSE: nlocrel 0
diff --git a/test/tools/llvm-objdump/X86/macho-section.test b/test/tools/llvm-objdump/X86/macho-section.test
index 720b9a4..e4d7857 100644
--- a/test/tools/llvm-objdump/X86/macho-section.test
+++ b/test/tools/llvm-objdump/X86/macho-section.test
@@ -1,4 +1,8 @@
// RUN: llvm-objdump -m -section __DATA,__mod_init_func %p/Inputs/dylibModInit.macho-x86_64 | FileCheck %s -check-prefix=MODINIT
+// RUN: llvm-objdump -m -section __DATA,__mod_init_func -non-verbose %p/Inputs/dylibModInit.macho-x86_64 | FileCheck %s -check-prefix=NON_VERBOSE
MODINIT: Contents of (__DATA,__mod_init_func) section
MODINIT: 0x0000000000001000 0x0000000000000f30 _libinit
+
+NON_VERBOSE: Contents of (__DATA,__mod_init_func) section
+NON_VERBOSE: 0000000000001000 30 0f 00 00 00 00 00 00
diff --git a/test/tools/llvm-objdump/X86/macho-symbolized-disassembly.test b/test/tools/llvm-objdump/X86/macho-symbolized-disassembly.test
index 1e1080a..6f49b45 100644
--- a/test/tools/llvm-objdump/X86/macho-symbolized-disassembly.test
+++ b/test/tools/llvm-objdump/X86/macho-symbolized-disassembly.test
@@ -7,6 +7,9 @@
// RUN: llvm-objdump -d -m -no-show-raw-insn -full-leading-addr -print-imm-hex %p/Inputs/hello.obj.macho-i386 | FileCheck %s -check-prefix=i386-OBJ
// RUN: llvm-objdump -d -m -no-show-raw-insn -full-leading-addr -print-imm-hex %p/Inputs/hello.exe.macho-i386 | FileCheck %s -check-prefix=i386-EXE
+// RUN: llvm-objdump -d -m -no-show-raw-insn -full-leading-addr -print-imm-hex -no-symbolic-operands %p/Inputs/hello.obj.macho-x86_64 | FileCheck %s -check-prefix=NO-SYM-OPS-OBJ
+// RUN: llvm-objdump -d -m -no-show-raw-insn -full-leading-addr -print-imm-hex -no-symbolic-operands %p/Inputs/hello.exe.macho-x86_64 | FileCheck %s -check-prefix=NO-SYM-OPS-EXE
+
OBJ: 0000000000000008 leaq L_.str(%rip), %rax ## literal pool for: "Hello world\n"
OBJ: 0000000000000026 callq _printf
@@ -36,3 +39,9 @@ CXX-EXE: 00000001000014cb callq __ZNSt3__116__pad_and_outputIcNS_11char_traitsIc
i386-OBJ: 0000002f calll _printf
i386-EXE: 00001f6f calll 0x1f84 ## symbol stub for: _printf
+
+NO-SYM-OPS-OBJ: 0000000000000008 leaq (%rip), %rax
+NO-SYM-OPS-OBJ: 0000000000000026 callq 0x2b
+
+NO-SYM-OPS-EXE: 0000000100000f38 leaq 0x4f(%rip), %rax
+NO-SYM-OPS-EXE: 0000000100000f56 callq 0x100000f6c
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
index e4fd37a..260e9aa 100644
--- a/test/tools/llvm-objdump/X86/macho-universal-x86_64.i386.test
+++ b/test/tools/llvm-objdump/X86/macho-universal-x86_64.i386.test
@@ -4,6 +4,8 @@ RUN: llvm-objdump %p/Inputs/macho-universal-archive.x86_64.i386 -d -m -no-show-r
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
+RUN: llvm-objdump %p/Inputs/macho-universal.x86_64.i386 -universal-headers -m \
+RUN: -non-verbose | FileCheck %s -check-prefix NON-VERBOSE
UEXE-all: macho-universal.x86_64.i386 (architecture x86_64):
UEXE-all: (__TEXT,__text) section
@@ -42,3 +44,21 @@ FAT: capabilities 0x0
FAT: offset 12288
FAT: size 4336
FAT: align 2^12 (4096)
+
+NON-VERBOSE: Fat headers
+NON-VERBOSE: fat_magic 0xcafebabe
+NON-VERBOSE: nfat_arch 2
+NON-VERBOSE: architecture 0
+NON-VERBOSE: cputype 16777223
+NON-VERBOSE: cpusubtype 3
+NON-VERBOSE: capabilities 0x80
+NON-VERBOSE: offset 4096
+NON-VERBOSE: size 4360
+NON-VERBOSE: align 2^12 (4096)
+NON-VERBOSE: architecture 1
+NON-VERBOSE: cputype 7
+NON-VERBOSE: cpusubtype 3
+NON-VERBOSE: capabilities 0x0
+NON-VERBOSE: offset 12288
+NON-VERBOSE: size 4336
+NON-VERBOSE: align 2^12 (4096)
diff --git a/test/tools/llvm-pdbdump/Inputs/ClassLayoutTest.cpp b/test/tools/llvm-pdbdump/Inputs/ClassLayoutTest.cpp
new file mode 100644
index 0000000..51c1b9b
--- /dev/null
+++ b/test/tools/llvm-pdbdump/Inputs/ClassLayoutTest.cpp
@@ -0,0 +1,64 @@
+// Compile with "cl /c /Zi /GR- ClassLayoutTest.cpp"
+// Link with "link ClassLayoutTest.obj /debug /nodefaultlib /entry:main"
+
+namespace MembersTest {
+ class A {
+ public:
+ typedef int NestedTypedef;
+ enum NestedEnum {
+ NestedEnumValue1
+ };
+
+ void MemberFunc() {}
+
+ private:
+ int IntMemberVar;
+ double DoubleMemberVar;
+ };
+}
+
+namespace GlobalsTest {
+ int IntVar;
+ double DoubleVar;
+
+ typedef int Typedef;
+ enum Enum {
+ Val1
+ } EnumVar;
+ Typedef TypedefVar;
+}
+
+namespace BaseClassTest {
+ class A {};
+ class B : public virtual A {};
+ class C : public virtual A {};
+ class D : protected B, private C {};
+}
+
+namespace UdtKindTest {
+ struct A {};
+ class B {};
+ union C {};
+}
+
+namespace BitFieldTest {
+ struct A {
+ int Bits1 : 1;
+ int Bits2 : 2;
+ int Bits3 : 3;
+ int Bits4 : 4;
+ int Bits22 : 22;
+ int Offset0x04;
+ };
+};
+
+int main(int argc, char **argv) {
+ MembersTest::A v1;
+ v1.MemberFunc();
+ BaseClassTest::D v2;
+ UdtKindTest::A v3;
+ UdtKindTest::B v4;
+ UdtKindTest::C v5;
+ BitFieldTest::A v7;
+ return 0;
+}
diff --git a/test/tools/llvm-pdbdump/Inputs/ClassLayoutTest.pdb b/test/tools/llvm-pdbdump/Inputs/ClassLayoutTest.pdb
new file mode 100644
index 0000000..5f5190d
--- /dev/null
+++ b/test/tools/llvm-pdbdump/Inputs/ClassLayoutTest.pdb
Binary files differ
diff --git a/test/tools/llvm-pdbdump/Inputs/FilterTest.cpp b/test/tools/llvm-pdbdump/Inputs/FilterTest.cpp
new file mode 100644
index 0000000..5f803e6
--- /dev/null
+++ b/test/tools/llvm-pdbdump/Inputs/FilterTest.cpp
@@ -0,0 +1,29 @@
+// Compile with "cl /c /Zi /GR- FilterTest.cpp"
+// Link with "link FilterTest.obj /debug /nodefaultlib /entry:main"
+
+class FilterTestClass {
+public:
+ typedef int NestedTypedef;
+ enum NestedEnum {
+ NestedEnumValue1
+ };
+
+ void MemberFunc() {}
+
+private:
+ int IntMemberVar;
+ double DoubleMemberVar;
+};
+
+int IntGlobalVar;
+double DoubleGlobalVar;
+typedef int GlobalTypedef;
+enum GlobalEnum {
+ GlobalEnumVal1
+} GlobalEnumVar;
+
+int main(int argc, char **argv) {
+ FilterTestClass TestClass;
+ GlobalTypedef v1;
+ return 0;
+}
diff --git a/test/tools/llvm-pdbdump/Inputs/FilterTest.pdb b/test/tools/llvm-pdbdump/Inputs/FilterTest.pdb
new file mode 100644
index 0000000..5f01ec7
--- /dev/null
+++ b/test/tools/llvm-pdbdump/Inputs/FilterTest.pdb
Binary files differ
diff --git a/test/tools/llvm-pdbdump/class-layout.test b/test/tools/llvm-pdbdump/class-layout.test
new file mode 100644
index 0000000..c46e62b
--- /dev/null
+++ b/test/tools/llvm-pdbdump/class-layout.test
@@ -0,0 +1,57 @@
+; RUN: llvm-pdbdump -all %p/Inputs/ClassLayoutTest.pdb > %t
+; RUN: FileCheck -input-file=%t %s -check-prefix=GLOBALS_TEST
+; RUN: FileCheck -input-file=%t %s -check-prefix=MEMBERS_TEST
+; RUN: FileCheck -input-file=%t %s -check-prefix=BASE_CLASS_A
+; RUN: FileCheck -input-file=%t %s -check-prefix=BASE_CLASS_B
+; RUN: FileCheck -input-file=%t %s -check-prefix=BASE_CLASS_C
+; RUN: FileCheck -input-file=%t %s -check-prefix=BASE_CLASS_D
+; RUN: FileCheck -input-file=%t %s -check-prefix=UDT_KIND_TEST
+; RUN: FileCheck -input-file=%t %s -check-prefix=BITFIELD_TEST
+
+; GLOBALS_TEST: ---GLOBALS---
+; GLOBALS_TEST-DAG: int GlobalsTest::IntVar
+; GLOBALS_TEST-DAG: double GlobalsTest::DoubleVar
+; GLOBALS_TEST-DAG: GlobalsTest::Enum GlobalsTest::EnumVar
+
+; MEMBERS_TEST: ---TYPES---
+; MEMBERS_TEST: class MembersTest::A {
+; MEMBERS_TEST-DAG: typedef int NestedTypedef
+; MEMBERS_TEST-DAG: enum NestedEnum
+; MEMBERS_TEST: public:
+; MEMBERS_TEST-NEXT: void MemberFunc()
+; MEMBERS_TEST-NEXT: private:
+; MEMBERS_TEST-DAG: int IntMemberVar
+; MEMBERS_TEST-DAG: double DoubleMemberVar
+; MEMBERS_TEST: }
+
+; BASE_CLASS_A: ---TYPES---
+; BASE_CLASS_A: class BaseClassTest::A {}
+
+; BASE_CLASS_B: ---TYPES---
+; BASE_CLASS_B: class BaseClassTest::B
+; BASE_CLASS_B-NEXT: : public virtual BaseClassTest::A {
+
+; BASE_CLASS_C: ---TYPES---
+; BASE_CLASS_C: class BaseClassTest::C
+; BASE_CLASS_C-NEXT: : public virtual BaseClassTest::A {
+
+; BASE_CLASS_D: ---TYPES---
+; BASE_CLASS_D: class BaseClassTest::D
+; BASE_CLASS_D-DAG: protected BaseClassTest::B
+; BASE_CLASS_D-DAG: private BaseClassTest::C
+; BASE_CLASS_D-DAG: protected virtual BaseClassTest::A
+
+; UDT_KIND_TEST: ---TYPES---
+; UDT_KIND_TEST-DAG: union UdtKindTest::C {}
+; UDT_KIND_TEST-DAG: class UdtKindTest::B {}
+; UDT_KIND_TEST-DAG: struct UdtKindTest::A {}
+
+; BITFIELD_TEST: ---TYPES---
+; BITFIELD_TEST: struct BitFieldTest::A {
+; BITFIELD_TEST-NEXT: public:
+; BITFIELD_TEST-NEXT: +0x00 int Bits1 : 1
+; BITFIELD_TEST-NEXT: +0x00 int Bits2 : 2
+; BITFIELD_TEST-NEXT: +0x00 int Bits3 : 3
+; BITFIELD_TEST-NEXT: +0x00 int Bits4 : 4
+; BITFIELD_TEST-NEXT: +0x00 int Bits22 : 22
+; BITFIELD_TEST-NEXT: +0x04 int Offset0x04
diff --git a/test/tools/llvm-pdbdump/enum-layout.test b/test/tools/llvm-pdbdump/enum-layout.test
new file mode 100644
index 0000000..c614553
--- /dev/null
+++ b/test/tools/llvm-pdbdump/enum-layout.test
@@ -0,0 +1,20 @@
+; RUN: llvm-pdbdump -types %p/Inputs/ClassLayoutTest.pdb > %t
+; RUN: FileCheck -input-file=%t %s -check-prefix=GLOBAL_ENUM
+; RUN: FileCheck -input-file=%t %s -check-prefix=MEMBER_ENUM
+
+; GLOBAL_ENUM: ---TYPES---
+; GLOBAL_ENUM: Enums:
+; GLOBAL_ENUM: enum GlobalsTest::Enum {
+; GLOBAL_ENUM-NEXT: Val1 = 0
+; GLOBAL_ENUM-NEXT: }
+
+; MEMBER_ENUM: ---TYPES---
+; MEMBER_ENUM: Classes:
+; MEMBER_ENUM: struct __vc_attributes::threadingAttribute {
+; MEMBER_ENUM-NEXT: enum threading_e {
+; MEMBER_ENUM-NEXT: apartment = 1
+; MEMBER_ENUM-NEXT: single = 2
+; MEMBER_ENUM-NEXT: free = 3
+; MEMBER_ENUM-NEXT: neutral = 4
+; MEMBER_ENUM-NEXT: both = 5
+; MEMBER_ENUM-NEXT: }
diff --git a/test/tools/llvm-pdbdump/lit.local.cfg b/test/tools/llvm-pdbdump/lit.local.cfg
new file mode 100644
index 0000000..28a895f
--- /dev/null
+++ b/test/tools/llvm-pdbdump/lit.local.cfg
@@ -0,0 +1 @@
+config.unsupported = not config.have_dia_sdk
diff --git a/test/tools/llvm-pdbdump/regex-filter.test b/test/tools/llvm-pdbdump/regex-filter.test
new file mode 100644
index 0000000..8b9eca6
--- /dev/null
+++ b/test/tools/llvm-pdbdump/regex-filter.test
@@ -0,0 +1,75 @@
+; RUN: llvm-pdbdump -symbols -globals -types %p/Inputs/FilterTest.pdb \
+; RUN: | FileCheck --check-prefix=NO_FILTER %s
+; RUN: llvm-pdbdump -types -exclude-types="GlobalTypedef|NestedTypedef" \
+; RUN: %p/Inputs/FilterTest.pdb | FileCheck --check-prefix=EXCLUDE_TYPEDEFS %s
+; RUN: llvm-pdbdump -types -exclude-types="GlobalEnum|NestedEnum" \
+; RUN: %p/Inputs/FilterTest.pdb | FileCheck --check-prefix=EXCLUDE_ENUMS %s
+; RUN: llvm-pdbdump -types -symbols -globals -exclude-symbols="MemberVar|GlobalVar" \
+; RUN: %p/Inputs/FilterTest.pdb | FileCheck --check-prefix=EXCLUDE_VARS %s
+; RUN: llvm-pdbdump -types -exclude-types="FilterTestClass" \
+; RUN: %p/Inputs/FilterTest.pdb | FileCheck --check-prefix=EXCLUDE_WHOLE_CLASS %s
+; RUN: llvm-pdbdump -symbols -globals -exclude-compilands="FilterTest.obj" \
+; RUN: %p/Inputs/FilterTest.pdb | FileCheck --check-prefix=EXCLUDE_COMPILAND %s
+
+; NO_FILTER: ---TYPES---
+; NO_FILTER: Enums:
+; NO_FILTER: enum GlobalEnum
+; NO_FILTER: Typedefs
+; NO_FILTER: typedef int GlobalTypedef
+; NO_FILTER: Classes:
+; NO_FILTER: struct __vc_attributes
+; NO_FILTER: class FilterTestClass
+; NO_FILTER-DAG: typedef int NestedTypedef
+; NO_FILTER-DAG: enum NestedEnum
+; NO_FILTER-DAG: int IntMemberVar
+; NO_FILTER-DAG: double DoubleMemberVar
+; NO_FILTER: ---SYMBOLS---
+; NO_FILTER: Inputs\FilterTest.obj
+; NO_FILTER: int __cdecl main(int argc, char** argv)
+; NO_FILTER: ---GLOBALS---
+; NO_FILTER-DAG: double DoubleGlobalVar
+; NO_FILTER-DAG: int IntGlobalVar
+; NO_FILTER-DAG: GlobalEnum GlobalEnumVar
+
+; EXCLUDE_TYPEDEFS: ---TYPES---
+; EXCLUDE_TYPEDEFS: Enums:
+; EXCLUDE_TYPEDEFS: GlobalEnum
+; EXCLUDE_TYPEDEFS: Typedefs
+; EXCLUDE_TYPEDEFS-NOT: GlobalTypedef
+; EXCLUDE_TYPEDEFS: Classes
+; EXCLUDE_TYPEDEFS: class FilterTestClass
+; EXCLUDE_TYPEDEFS-NOT: NestedTypedef
+; EXCLUDE_TYPEDEFS: private:
+
+; EXCLUDE_ENUMS: ---TYPES---
+; EXCLUDE_ENUMS: Enums:
+; EXCLUDE_ENUMS-NOT: GlobalEnum
+; EXCLUDE_ENUMS: Typedefs
+; EXCLUDE_ENUMS: GlobalTypedef
+; EXCLUDE_ENUMS: Classes
+; EXCLUDE_ENUMS: class FilterTestClass
+; EXCLUDE_ENUMS-NOT: NestedEnum
+; EXCLUDE_ENUMS: private:
+
+; EXCLUDE_VARS: ---TYPES---
+; EXCLUDE_VARS: Classes:
+; EXCLUDE_VARS: class FilterTestClass
+; EXCLUDE_VARS: private:
+; EXCLUDE_VARS-NOT: IntMemberVar
+; EXCLUDE_VARS-NOT: DoubleMemberVar
+; EXCLUDE_VARS: ---GLOBALS---
+; EXCLUDE_VARS-NOT: DoubleGlobalVar
+; EXCLUDE_VARS-NOT: IntGlobalVar
+
+; EXCLUDE_WHOLE_CLASS: ---TYPES---
+; EXCLUDE_WHOLE_CLASS-NOT: class FilterTestClass
+; EXCLUDE_WHOLE_CLASS-NOT: typedef int NestedTypedef
+; EXCLUDE_WHOLE_CLASS-NOT: enum NestedEnum
+; EXCLUDE_WHOLE_CLASS-NOT: int IntMemberVar
+; EXCLUDE_WHOLE_CLASS-NOT: double DoubleMemberVar
+
+; EXCLUDE_COMPILAND: ---SYMBOLS---
+; EXCLUDE_COMPILAND-NOT: FilterTest.obj
+; EXCLUDE_COMPILAND-NOT: __cdecl main
+; EXCLUDE_COMPILAND: * Linker *
+; EXCLUDE_COMPILAND: ---GLOBALS---
diff --git a/test/tools/llvm-profdata/general.proftext b/test/tools/llvm-profdata/general.proftext
index 591d262..5302fce 100644
--- a/test/tools/llvm-profdata/general.proftext
+++ b/test/tools/llvm-profdata/general.proftext
@@ -38,6 +38,14 @@ large_numbers
# LARGENUM-NEXT: Function count: 2305843009213693952
# LARGENUM-NEXT: Block counts: [1152921504606846976, 576460752303423488, 288230376151711744, 144115188075855872, 72057594037927936]
+# RUN: llvm-profdata show %t.profdata --function hex_hash | FileCheck %s -check-prefix=HEX-HASH
+hex_hash
+0x1234
+1
+0
+# HEX-HASH: Hash: 0x0000000000001234
+# HEX-HASH-NEXT: Counters: 1
+
# RUN: llvm-profdata show %t.profdata --function NOSUCHFUNC | FileCheck %s -check-prefix=NOSUCHFUNC
# NOSUCHFUNC-NOT: Counters:
# NOSUCHFUNC: Functions shown: 0
@@ -46,11 +54,11 @@ large_numbers
# SOMEFUNCS: Counters:
# SOMEFUNCS: function_count_only:
# SOMEFUNCS: large_numbers:
-# SOMEFUNCS: Functions shown: 2
+# SOMEFUNCS: Functions shown: 3
# RUN: llvm-profdata show %t.profdata | FileCheck %s -check-prefix=SUMMARY
# SUMMARY-NOT: Counters:
# SUMMARY-NOT: Functions shown:
-# SUMMARY: Total functions: 3
+# SUMMARY: Total functions: 4
# SUMMARY: Maximum function count: 2305843009213693952
# SUMMARY: Maximum internal block count: 1152921504606846976
diff --git a/test/tools/llvm-readobj/Inputs/macho-universal.x86_64.i386 b/test/tools/llvm-readobj/Inputs/macho-universal.x86_64.i386
new file mode 100644
index 0000000..36d5fc2
--- /dev/null
+++ b/test/tools/llvm-readobj/Inputs/macho-universal.x86_64.i386
Binary files differ
diff --git a/test/tools/llvm-readobj/Inputs/trivial.ll b/test/tools/llvm-readobj/Inputs/trivial.ll
index 2cd7ec8..f79b8b8 100644
--- a/test/tools/llvm-readobj/Inputs/trivial.ll
+++ b/test/tools/llvm-readobj/Inputs/trivial.ll
@@ -9,7 +9,7 @@
define i32 @main() nounwind {
entry:
- %call = tail call i32 @puts(i8* getelementptr inbounds ([13 x i8]* @.str, i32 0, i32 0)) nounwind
+ %call = tail call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i32 0, i32 0)) nounwind
tail call void bitcast (void (...)* @SomeOtherFunction to void ()*)() nounwind
ret i32 0
}
diff --git a/test/tools/llvm-readobj/macho-universal-x86_64.i386.test b/test/tools/llvm-readobj/macho-universal-x86_64.i386.test
new file mode 100644
index 0000000..502e0fb
--- /dev/null
+++ b/test/tools/llvm-readobj/macho-universal-x86_64.i386.test
@@ -0,0 +1,141 @@
+RUN: llvm-readobj -h %p/Inputs/macho-universal.x86_64.i386 \
+RUN: | FileCheck %s -check-prefix MULTIHEADER
+
+RUN: llvm-readobj -sections %p/Inputs/macho-universal.x86_64.i386 \
+RUN: | FileCheck %s -check-prefix MULTISECTIONS
+
+MULTIHEADER: Format: Mach-O 64-bit x86-64
+MULTIHEADER: Arch: x86_64
+MULTIHEADER: AddressSize: 64bit
+MULTIHEADER: MachHeader {
+MULTIHEADER: Magic: Magic64 (0xFEEDFACF)
+MULTIHEADER: CpuType: X86-64 (0x1000007)
+MULTIHEADER: CpuSubType: CPU_SUBTYPE_X86_64_ALL (0x3)
+MULTIHEADER: FileType: Executable (0x2)
+MULTIHEADER: NumOfLoadCommands: 16
+MULTIHEADER: SizeOfLoadCommands: 880
+MULTIHEADER: Flags [ (0x200085)
+MULTIHEADER: MH_DYLDLINK (0x4)
+MULTIHEADER: MH_NOUNDEFS (0x1)
+MULTIHEADER: MH_PIE (0x200000)
+MULTIHEADER: MH_TWOLEVEL (0x80)
+MULTIHEADER: ]
+MULTIHEADER: Reserved: 0x0
+MULTIHEADER: }
+
+MULTIHEADER: Format: Mach-O 32-bit i386
+MULTIHEADER: Arch: i386
+MULTIHEADER: AddressSize: 32bit
+MULTIHEADER: MachHeader {
+MULTIHEADER: Magic: Magic (0xFEEDFACE)
+MULTIHEADER: CpuType: X86 (0x7)
+MULTIHEADER: CpuSubType: CPU_SUBTYPE_I386_ALL (0x3)
+MULTIHEADER: FileType: Executable (0x2)
+MULTIHEADER: NumOfLoadCommands: 16
+MULTIHEADER: SizeOfLoadCommands: 716
+MULTIHEADER: Flags [ (0x1200085)
+MULTIHEADER: MH_DYLDLINK (0x4)
+MULTIHEADER: MH_NOUNDEFS (0x1)
+MULTIHEADER: MH_NO_HEAP_EXECUTION (0x1000000)
+MULTIHEADER: MH_PIE (0x200000)
+MULTIHEADER: MH_TWOLEVEL (0x80)
+MULTIHEADER: ]
+MULTIHEADER: }
+
+
+
+MULTISECTIONS: Format: Mach-O 64-bit x86-64
+MULTISECTIONS: Arch: x86_64
+MULTISECTIONS: AddressSize: 64bit
+MULTISECTIONS: Sections [
+MULTISECTIONS: Section {
+MULTISECTIONS: Index: 0
+MULTISECTIONS: Name: __text (5F 5F 74 65 78 74 00 00 00 00 00 00 00 00 00 00)
+MULTISECTIONS: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
+MULTISECTIONS: Address: 0x100000F60
+MULTISECTIONS: Size: 0x12
+MULTISECTIONS: Offset: 3936
+MULTISECTIONS: Alignment: 4
+MULTISECTIONS: RelocationOffset: 0x0
+MULTISECTIONS: RelocationCount: 0
+MULTISECTIONS: Type: 0x0
+MULTISECTIONS: Attributes [ (0x800004)
+MULTISECTIONS: PureInstructions (0x800000)
+MULTISECTIONS: SomeInstructions (0x4)
+MULTISECTIONS: ]
+MULTISECTIONS: Reserved1: 0x0
+MULTISECTIONS: Reserved2: 0x0
+MULTISECTIONS: }
+MULTISECTIONS: Section {
+MULTISECTIONS: Index: 1
+MULTISECTIONS: Name: __unwind_info (5F 5F 75 6E 77 69 6E 64 5F 69 6E 66 6F 00 00 00)
+MULTISECTIONS: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
+MULTISECTIONS: Address: 0x100000F72
+MULTISECTIONS: Size: 0x48
+MULTISECTIONS: Offset: 3954
+MULTISECTIONS: Alignment: 0
+MULTISECTIONS: RelocationOffset: 0x0
+MULTISECTIONS: RelocationCount: 0
+MULTISECTIONS: Type: 0x0
+MULTISECTIONS: Attributes [ (0x0)
+MULTISECTIONS: ]
+MULTISECTIONS: Reserved1: 0x0
+MULTISECTIONS: Reserved2: 0x0
+MULTISECTIONS: }
+MULTISECTIONS: Section {
+MULTISECTIONS: Index: 2
+MULTISECTIONS: Name: __eh_frame (5F 5F 65 68 5F 66 72 61 6D 65 00 00 00 00 00 00)
+MULTISECTIONS: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
+MULTISECTIONS: Address: 0x100000FC0
+MULTISECTIONS: Size: 0x40
+MULTISECTIONS: Offset: 4032
+MULTISECTIONS: Alignment: 3
+MULTISECTIONS: RelocationOffset: 0x0
+MULTISECTIONS: RelocationCount: 0
+MULTISECTIONS: Type: 0x0
+MULTISECTIONS: Attributes [ (0x0)
+MULTISECTIONS: ]
+MULTISECTIONS: Reserved1: 0x0
+MULTISECTIONS: Reserved2: 0x0
+MULTISECTIONS: }
+MULTISECTIONS: ]
+
+MULTISECTIONS: Format: Mach-O 32-bit i386
+MULTISECTIONS: Arch: i386
+MULTISECTIONS: AddressSize: 32bit
+MULTISECTIONS: Sections [
+MULTISECTIONS: Section {
+MULTISECTIONS: Index: 0
+MULTISECTIONS: Name: __text (5F 5F 74 65 78 74 00 00 00 00 00 00 00 00 00 00)
+MULTISECTIONS: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
+MULTISECTIONS: Address: 0x1FA0
+MULTISECTIONS: Size: 0x15
+MULTISECTIONS: Offset: 4000
+MULTISECTIONS: Alignment: 4
+MULTISECTIONS: RelocationOffset: 0x0
+MULTISECTIONS: RelocationCount: 0
+MULTISECTIONS: Type: 0x0
+MULTISECTIONS: Attributes [ (0x800004)
+MULTISECTIONS: PureInstructions (0x800000)
+MULTISECTIONS: SomeInstructions (0x4)
+MULTISECTIONS: ]
+MULTISECTIONS: Reserved1: 0x0
+MULTISECTIONS: Reserved2: 0x0
+MULTISECTIONS: }
+MULTISECTIONS: Section {
+MULTISECTIONS: Index: 1
+MULTISECTIONS: Name: __unwind_info (5F 5F 75 6E 77 69 6E 64 5F 69 6E 66 6F 00 00 00)
+MULTISECTIONS: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
+MULTISECTIONS: Address: 0x1FB5
+MULTISECTIONS: Size: 0x48
+MULTISECTIONS: Offset: 4021
+MULTISECTIONS: Alignment: 0
+MULTISECTIONS: RelocationOffset: 0x0
+MULTISECTIONS: RelocationCount: 0
+MULTISECTIONS: Type: 0x0
+MULTISECTIONS: Attributes [ (0x0)
+MULTISECTIONS: ]
+MULTISECTIONS: Reserved1: 0x0
+MULTISECTIONS: Reserved2: 0x0
+MULTISECTIONS: }
+MULTISECTIONS: ]
diff --git a/test/tools/lto/lit.local.cfg b/test/tools/lto/lit.local.cfg
new file mode 100644
index 0000000..b91f8f4
--- /dev/null
+++ b/test/tools/lto/lit.local.cfg
@@ -0,0 +1,2 @@
+if not 'ld64_plugin' in config.available_features:
+ config.unsupported = True
diff --git a/test/tools/lto/opt-level.ll b/test/tools/lto/opt-level.ll
new file mode 100644
index 0000000..013a1f4
--- /dev/null
+++ b/test/tools/lto/opt-level.ll
@@ -0,0 +1,20 @@
+; RUN: llvm-as %s -o %t.o
+; RUN: env DYLD_LIBRARY_PATH=%llvmshlibdir %ld64 -arch x86_64 -dylib -mllvm -O0 -o %t.dylib %t.o
+; RUN: llvm-nm -no-llvm-bc %t.dylib | FileCheck --check-prefix=CHECK-O0 %s
+; RUN: env DYLD_LIBRARY_PATH=%llvmshlibdir %ld64 -arch x86_64 -dylib -mllvm -O2 -o %t.dylib %t.o
+; RUN: llvm-nm -no-llvm-bc %t.dylib | FileCheck --check-prefix=CHECK-O2 %s
+
+target triple = "x86_64-apple-macosx10.8.0"
+
+; CHECK-O0: t _f1
+; CHECK-O2-NOT: _f1
+define internal void @f1() {
+ ret void
+}
+
+; CHECK-O0: T _f2
+; CHECK-O2: T _f2
+define void @f2() {
+ call void @f1()
+ ret void
+}