Imported Upstream version 5.18.0.247

Former-commit-id: 2d6af2e4ed0eda5cbdc2946446ef7718456ad190
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2019-01-25 08:19:26 +00:00
parent 279aa8f685
commit ce8e504569
28478 changed files with 39 additions and 3866962 deletions

View File

@@ -1,19 +0,0 @@
# RUN: llvm-dsymutil -f -oso-prepend-path=%p/../Inputs/alias \
# RUN: %p/../Inputs/alias/foobar -o - | llvm-dwarfdump - 2>&1 | FileCheck %s
# CHECK-NOT: could not find object file symbol for symbol
# CHECK: DW_AT_name ("foo.c")
# CHECK: DW_AT_name ("bar.c")
# Source:
# $ cat foo.c
# int foo = 1;
# $ cat bar.c
# extern int bar;
# int main() {
# return bar;
# }
# Compile with:
# $ clang -g -O0 bar.c -c -o bar.o
# $ clang -g -O0 foo.c -c -o foo.o
# $ ld -arch x86_64 -macosx_version_min 10.13.0 foo.o bar.o -lSystem -alias _foo _bar -o foobar

View File

@@ -1,38 +0,0 @@
RUN: rm -rf %t
RUN: mkdir -p %t/dsymdest
RUN: cat %p/../Inputs/basic.macho.x86_64 > %t/basic.macho.x86_64
RUN: llvm-dsymutil -oso-prepend-path=%p/.. %t/basic.macho.x86_64
Check that the object file in the bundle exists and is sane:
RUN: llvm-dwarfdump -a %t/basic.macho.x86_64.dSYM/Contents/Resources/DWARF/basic.macho.x86_64 | FileCheck %S/basic-linking-x86.test
Check that llvm-dwarfdump -a recognizes the bundle as a dSYM:
RUN: llvm-dwarfdump -a %t/basic.macho.x86_64.dSYM | FileCheck %S/basic-linking-x86.test
RUN: FileCheck %s --input-file %t/basic.macho.x86_64.dSYM/Contents/Info.plist
RUN: llvm-dsymutil -oso-prepend-path=%p/.. %t/basic.macho.x86_64 -o %t/dsymdest/basic.macho.x86_64.dSYM
RUN: llvm-dwarfdump -a %t/dsymdest/basic.macho.x86_64.dSYM/Contents/Resources/DWARF/basic.macho.x86_64 | FileCheck %S/basic-linking-x86.test
RUN: FileCheck %s --input-file %t/dsymdest/basic.macho.x86_64.dSYM/Contents/Info.plist
CHECK: <?xml version="1.0" encoding="UTF-8"?>
CHECK-NEXT: <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
CHECK-NEXT: <plist version="1.0">
CHECK-NEXT: <dict>
CHECK-NEXT: <key>CFBundleDevelopmentRegion</key>
CHECK-NEXT: <string>English</string>
CHECK-NEXT: <key>CFBundleIdentifier</key>
CHECK-NEXT: <string>com.apple.xcode.dsym.basic.macho.x86_64</string>
CHECK-NEXT: <key>CFBundleInfoDictionaryVersion</key>
CHECK-NEXT: <string>6.0</string>
CHECK-NEXT: <key>CFBundlePackageType</key>
CHECK-NEXT: <string>dSYM</string>
CHECK-NEXT: <key>CFBundleSignature</key>
CHECK-NEXT: <string>????</string>
CHECK-NEXT: <key>CFBundleShortVersionString</key>
CHECK-NEXT: <string>1.0</string>
CHECK-NEXT: <key>CFBundleVersion</key>
CHECK-NEXT: <string>1</string>
CHECK-NEXT: </dict>
CHECK-NEXT: </plist>

View File

@@ -1,218 +0,0 @@
RUN: cat %p/../Inputs/basic.macho.x86_64 > %t1
RUN: llvm-dsymutil -f -oso-prepend-path=%p/.. %t1
RUN: llvm-dwarfdump -a %t1.dwarf | FileCheck %s
RUN: llvm-dsymutil -f -o %t2 -oso-prepend-path=%p/.. %p/../Inputs/basic.macho.x86_64
RUN: llvm-dwarfdump -a %t2 | FileCheck %s
RUN: llvm-dsymutil -f -o - -oso-prepend-path=%p/.. %p/../Inputs/basic.macho.x86_64 | llvm-dwarfdump -a - | FileCheck %s --check-prefix=CHECK --check-prefix=BASIC
RUN: llvm-dsymutil -f -o - -oso-prepend-path=%p/.. %p/../Inputs/basic-archive.macho.x86_64 | llvm-dwarfdump -a - | FileCheck %s --check-prefix=CHECK --check-prefix=ARCHIVE
RUN: llvm-dsymutil -dump-debug-map -oso-prepend-path=%p/.. %p/../Inputs/basic.macho.x86_64 | llvm-dsymutil -f -y -o - - | llvm-dwarfdump -a - | FileCheck %s --check-prefix=CHECK --check-prefix=BASIC
RUN: llvm-dsymutil -dump-debug-map -oso-prepend-path=%p/.. %p/../Inputs/basic-archive.macho.x86_64 | llvm-dsymutil -f -o - -y - | llvm-dwarfdump -a - | 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
CHECK: DW_AT_producer ("Apple LLVM version 6.0 (clang-600.0.39) (based on LLVM 3.5svn)")
CHECK: DW_AT_language (DW_LANG_C99)
CHECK: DW_AT_name ("basic1.c")
CHECK: DW_AT_stmt_list (0x00000000)
CHECK: DW_AT_comp_dir ("/Inputs")
CHECK: DW_AT_low_pc (0x0000000100000ea0)
CHECK: DW_TAG_subprogram
CHECK: DW_AT_name ("main")
CHECK: DW_AT_decl_file ("/Inputs{{[/\\]}}basic1.c")
CHECK: DW_AT_decl_line (23)
CHECK: DW_AT_prototyped (0x01)
CHECK: DW_AT_type (cu + 0x0063
CHECK: DW_AT_external (0x01)
CHECK: DW_AT_accessibility (DW_ACCESS_public)
CHECK: DW_AT_low_pc (0x0000000100000ea0)
CHECK: DW_AT_high_pc (0x0000000100000ec4)
CHECK: DW_AT_frame_base (DW_OP_reg6 RBP)
CHECK: DW_TAG_formal_parameter
CHECK: DW_AT_name ("argc")
CHECK: DW_AT_decl_file ("/Inputs{{[/\\]}}basic1.c")
CHECK: DW_AT_decl_line (23)
CHECK: DW_AT_type (cu + 0x0063
CHECK: DW_AT_location (DW_OP_fbreg -8)
CHECK: DW_TAG_formal_parameter
CHECK: DW_AT_name ("argv")
CHECK: DW_AT_decl_file ("/Inputs{{[/\\]}}basic1.c")
CHECK: DW_AT_decl_line (23)
CHECK: DW_AT_type (cu + 0x006a
CHECK: DW_AT_location (DW_OP_fbreg -16)
CHECK: NULL
CHECK: DW_TAG_base_type
CHECK: DW_AT_name ("int")
CHECK: DW_AT_encoding (DW_ATE_signed)
CHECK: DW_AT_byte_size (0x04)
CHECK: DW_TAG_pointer_type
CHECK: DW_AT_type (cu + 0x006f
CHECK: DW_TAG_pointer_type
CHECK: DW_AT_type (cu + 0x0074
CHECK: DW_TAG_const_type
CHECK: DW_AT_type (cu + 0x0079
CHECK: DW_TAG_base_type
CHECK: DW_AT_name ("char")
CHECK: DW_AT_encoding (DW_ATE_signed_char)
CHECK: DW_AT_byte_size (0x01)
CHECK: NULL
CHECK: Compile Unit:
CHECK: DW_TAG_compile_unit
CHECK: DW_AT_producer ("Apple LLVM version 6.0 (clang-600.0.39) (based on LLVM 3.5svn)")
CHECK: DW_AT_name ("basic2.c")
CHECK: DW_AT_stmt_list (0x0000003f)
CHECK: DW_AT_comp_dir ("/Inputs")
CHECK: DW_AT_low_pc (0x0000000100000ed0)
CHECK: DW_TAG_base_type
CHECK: DW_AT_name ("int")
CHECK: DW_TAG_variable
CHECK: DW_AT_name ("private_int")
CHECK: DW_AT_type (cu + 0x0026
CHECK: DW_AT_decl_file ("/Inputs{{[/\\]}}basic2.c")
BASIC: DW_AT_location (DW_OP_addr 0x100001008)
ARCHIVE: DW_AT_location (DW_OP_addr 0x100001004)
CHECK: DW_TAG_variable
CHECK: DW_AT_name ("baz")
CHECK: DW_AT_type (cu + 0x0026
CHECK: DW_AT_decl_file ("/Inputs{{[/\\]}}basic2.c")
CHECK: DW_AT_location (DW_OP_addr 0x100001000)
CHECK: DW_TAG_subprogram
CHECK: DW_AT_name ("foo")
CHECK: DW_AT_decl_file ("/Inputs{{[/\\]}}basic2.c")
CHECK: DW_AT_type (cu + 0x0026
CHECK: DW_AT_low_pc (0x0000000100000ed0)
CHECK: DW_AT_high_pc (0x0000000100000f19)
CHECK: DW_AT_frame_base (DW_OP_reg6 RBP)
CHECK: DW_TAG_formal_parameter
CHECK: DW_AT_name ("arg")
CHECK: DW_AT_type (cu + 0x0026
CHECK: DW_AT_location (DW_OP_fbreg -4)
CHECK: NULL
CHECK: DW_TAG_subprogram
CHECK: DW_AT_name ("inc")
CHECK: DW_AT_type (cu + 0x0026
CHECK: DW_AT_low_pc (0x0000000100000f20)
CHECK: DW_AT_high_pc (0x0000000100000f37)
CHECK: DW_AT_frame_base (DW_OP_reg6 RBP)
CHECK: NULL
CHECK: Compile Unit:
CHECK: DW_TAG_compile_unit
CHECK: DW_AT_producer ("Apple LLVM version 6.0 (clang-600.0.39) (based on LLVM 3.5svn)")
CHECK: DW_AT_name ("basic3.c")
CHECK: DW_AT_stmt_list (0x00000093)
CHECK: DW_AT_comp_dir ("/Inputs")
CHECK: DW_AT_low_pc (0x0000000100000f40)
CHECK: DW_TAG_variable
CHECK: DW_AT_name ("val")
CHECK: DW_AT_type (cu + 0x003c
CHECK: DW_AT_decl_file ("/Inputs{{[/\\]}}basic3.c")
BASIC: DW_AT_location (DW_OP_addr 0x100001004)
ARCHIVE: DW_AT_location (DW_OP_addr 0x100001008)
CHECK: DW_TAG_volatile_type
CHECK: DW_AT_type (cu + 0x0041
CHECK: DW_TAG_base_type
CHECK: DW_AT_name ("int")
CHECK: DW_TAG_subprogram
CHECK: DW_AT_name ("bar")
CHECK: DW_AT_type (cu + 0x0041
CHECK: DW_AT_low_pc (0x0000000100000f40)
CHECK: DW_AT_high_pc (0x0000000100000f84)
CHECK: DW_AT_frame_base (DW_OP_reg6 RBP)
CHECK: DW_TAG_formal_parameter
CHECK: DW_AT_name ("arg")
CHECK: DW_AT_type (cu + 0x0041
CHECK: DW_AT_location (DW_OP_fbreg -8)
CHECK: NULL
CHECK: DW_TAG_subprogram
CHECK: DW_AT_name ("inc")
CHECK: DW_AT_type (cu + 0x0041
CHECK: DW_AT_low_pc (0x0000000100000f90)
CHECK: DW_AT_high_pc (0x0000000100000fa9)
CHECK: DW_AT_frame_base (DW_OP_reg6 RBP)
CHECK: NULL
CHECK-NOT: .debug_loc contents
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"

View File

@@ -1,202 +0,0 @@
RUN: llvm-dsymutil -f -o - -oso-prepend-path=%p/.. %p/../Inputs/basic-lto-dw4.macho.x86_64 | llvm-dwarfdump -a - | 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
CHECK: DW_AT_producer ("clang version 3.7.0 ")
CHECK: DW_AT_language (DW_LANG_C99)
CHECK: DW_AT_name ("basic1.c")
CHECK: DW_AT_stmt_list (0x00000000)
CHECK: DW_AT_comp_dir ("/Inputs")
CHECK: DW_AT_low_pc (0x0000000100000f40)
CHECK: DW_AT_high_pc (0x0000000100000f4b)
CHECK: DW_TAG_subprogram
CHECK: DW_AT_low_pc (0x0000000100000f40)
CHECK: DW_AT_high_pc (0x0000000100000f4b)
CHECK: DW_AT_frame_base (DW_OP_reg6 RBP)
CHECK: DW_AT_name ("main")
CHECK: DW_AT_decl_file ("/Inputs{{[/\\]}}basic1.c")
CHECK: DW_AT_prototyped (true)
CHECK: DW_AT_type (0x00000000000000a1
CHECK: DW_AT_external (true)
CHECK: DW_TAG_formal_parameter
CHECK: DW_AT_location (DW_OP_reg5 RDI, DW_OP_piece 0x4)
CHECK: DW_AT_name ("argc")
CHECK: DW_AT_decl_file ("/Inputs{{[/\\]}}basic1.c")
CHECK: DW_AT_type (0x00000000000000a1
CHECK: DW_TAG_formal_parameter
CHECK: DW_AT_location (DW_OP_reg4 RSI)
CHECK: DW_AT_name ("argv")
CHECK: DW_AT_type (cu + 0x0060
CHECK: NULL
CHECK: DW_TAG_pointer_type
CHECK: DW_AT_type (cu + 0x0065
CHECK: DW_TAG_pointer_type
CHECK: DW_TAG_const_type
CHECK: DW_TAG_base_type
CHECK: DW_AT_name ("char")
CHECK: DW_AT_encoding (DW_ATE_signed_char)
CHECK: DW_AT_byte_size (0x01)
CHECK: NULL
CHECK: Compile Unit:{{.*}} version = 0x0004
CHECK: DW_TAG_compile_unit
CHECK: DW_AT_producer ("clang version 3.7.0 ")
CHECK: DW_AT_language (DW_LANG_C99)
CHECK: DW_AT_name ("basic2.c")
CHECK: DW_AT_stmt_list (0x00000044)
CHECK: DW_AT_low_pc (0x0000000100000f50)
CHECK: DW_AT_high_pc (0x0000000100000f87)
CHECK: DW_TAG_base_type
CHECK: DW_AT_name ("int")
CHECK: DW_TAG_variable
CHECK: DW_AT_name ("baz")
CHECK: DW_AT_location (DW_OP_addr 0x100001000)
CHECK: DW_TAG_variable
CHECK: DW_AT_name ("private_int")
CHECK: DW_AT_decl_file ("/Inputs{{[/\\]}}basic2.c")
CHECK: DW_AT_location (DW_OP_addr 0x100001008)
CHECK: DW_TAG_subprogram
CHECK: DW_AT_name ("inc")
CHECK: DW_AT_type (cu + 0x002a
CHECK: DW_AT_inline (DW_INL_inlined)
CHECK: DW_TAG_subprogram
CHECK: DW_AT_low_pc (0x0000000100000f50)
CHECK: DW_AT_high_pc (0x0000000100000f87)
CHECK: DW_AT_frame_base (DW_OP_reg6 RBP)
CHECK: DW_AT_name ("foo")
CHECK: DW_AT_decl_file ("/Inputs{{[/\\]}}basic2.c")
CHECK: DW_AT_prototyped (true)
CHECK: DW_AT_type (cu + 0x002a
CHECK: DW_TAG_formal_parameter
CHECK: DW_AT_location (0x00000000
CHECK: 0x0000000000000000 - 0x000000000000000c: DW_OP_reg5 RDI, DW_OP_piece 0x4)
CHECK: DW_AT_name ("arg")
CHECK: DW_AT_type (cu + 0x002a
CHECK: DW_TAG_inlined_subroutine
CHECK: DW_AT_abstract_origin (cu + 0x005b "inc")
CHECK: DW_AT_low_pc (0x0000000100000f61)
CHECK: DW_AT_high_pc (0x0000000100000f70)
CHECK: NULL
CHECK: NULL
CHECK: Compile Unit: {{.*}} version = 0x0004
CHECK: DW_TAG_compile_unit
CHECK: DW_AT_producer ("clang version 3.7.0 ")
CHECK: DW_AT_name ("basic3.c")
CHECK: DW_AT_stmt_list (0x0000009a)
CHECK: DW_AT_low_pc (0x0000000100000f90)
CHECK: DW_AT_high_pc (0x0000000100000fb4)
CHECK: DW_TAG_variable
CHECK: DW_AT_name ("val")
CHECK: DW_AT_decl_file ("/Inputs{{[/\\]}}basic3.c")
CHECK: DW_AT_location (DW_OP_addr 0x100001004)
CHECK: DW_TAG_volatile_type
CHECK: DW_TAG_subprogram
CHECK: DW_AT_name ("inc")
CHECK: DW_AT_inline (DW_INL_inlined)
CHECK: DW_TAG_subprogram
CHECK: DW_AT_low_pc (0x0000000100000f90)
CHECK: DW_AT_high_pc (0x0000000100000fb4)
CHECK: DW_AT_frame_base (DW_OP_reg6 RBP)
CHECK: DW_AT_name ("bar")
CHECK: DW_TAG_formal_parameter
CHECK: DW_AT_location (0x00000025
CHECK: 0x0000000000000000 - 0x000000000000000f: DW_OP_reg5 RDI, DW_OP_piece 0x4
CHECK: 0x0000000000000019 - 0x000000000000001d: DW_OP_reg5 RDI, DW_OP_piece 0x4)
CHECK: DW_AT_name ("arg")
CHECK: DW_TAG_inlined_subroutine
CHECK: DW_AT_abstract_origin (cu + 0x0044 "inc")
CHECK: DW_AT_ranges (0x00000000
CHECK: [0x0000000100000f94 - 0x0000000100000f9a)
CHECK: [0x0000000100000f9f - 0x0000000100000fa7))
CHECK: NULL
CHECK: NULL
CHECK: .debug_loc contents:
CHECK-NEXT: 0x00000000:
CHECK-NEXT: 0x0000000000000000 - 0x000000000000000c: DW_OP_reg5 RDI, DW_OP_piece 0x4
CHECK-NOT: :
CHECK: 0x00000025:
CHECK-NEXT: 0x0000000000000000 - 0x000000000000000f: DW_OP_reg5 RDI, DW_OP_piece 0x4
CHECK-NEXT: 0x0000000000000019 - 0x000000000000001d: DW_OP_reg5 RDI, DW_OP_piece 0x4
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"

View File

@@ -1,199 +0,0 @@
RUN: llvm-dsymutil -f -o - -oso-prepend-path=%p/.. %p/../Inputs/basic-lto.macho.x86_64 | llvm-dwarfdump -a - | FileCheck %s
RUN: llvm-dsymutil -oso-prepend-path=%p/.. -dump-debug-map %p/../Inputs/basic-lto.macho.x86_64 | llvm-dsymutil -f -o - -y - | llvm-dwarfdump -a - | FileCheck %s
CHECK: file format Mach-O 64-bit x86-64
CHECK: debug_info contents
CHECK: Compile Unit:
CHECK: DW_TAG_compile_unit
CHECK: DW_AT_producer ("Apple LLVM version 6.0 (clang-600.0.39) (based on LLVM 3.5svn)")
CHECK: DW_AT_language (DW_LANG_C99)
CHECK: DW_AT_name ("basic1.c")
CHECK: DW_AT_stmt_list (0x00000000)
CHECK: DW_AT_comp_dir ("/Inputs")
CHECK: DW_AT_low_pc (0x0000000100000f40)
CHECK: DW_TAG_subprogram
CHECK: DW_AT_name ("main")
CHECK: DW_AT_decl_file ("/Inputs{{[/\\]}}basic1.c")
CHECK: DW_AT_decl_line (23)
CHECK: DW_AT_prototyped (0x01)
CHECK: DW_AT_type (cu + 0x0063
CHECK: DW_AT_external (0x01)
CHECK: DW_AT_accessibility (DW_ACCESS_public)
CHECK: DW_AT_low_pc (0x0000000100000f40)
CHECK: DW_AT_high_pc (0x0000000100000f4b)
CHECK: DW_AT_frame_base (DW_OP_reg6 RBP)
CHECK: DW_TAG_formal_parameter
CHECK: DW_AT_name ("argc")
CHECK: DW_AT_type (cu + 0x0063
CHECK: DW_AT_location (DW_OP_reg5 RDI, DW_OP_piece 0x4)
CHECK: DW_TAG_formal_parameter
CHECK: DW_AT_name ("argv")
CHECK: DW_AT_type (cu + 0x006a
CHECK: DW_AT_location (DW_OP_reg4 RSI)
CHECK: NULL
CHECK: DW_TAG_base_type
CHECK: DW_AT_name ("int")
CHECK: DW_AT_encoding (DW_ATE_signed)
CHECK: DW_AT_byte_size (0x04)
CHECK: DW_TAG_pointer_type
CHECK: DW_AT_type (cu + 0x006f
CHECK: DW_TAG_pointer_type
CHECK: DW_AT_type (cu + 0x0074
CHECK: DW_TAG_const_type
CHECK: DW_AT_type (cu + 0x0079
CHECK: DW_TAG_base_type
CHECK: DW_AT_name ("char")
CHECK: DW_AT_encoding (DW_ATE_signed_char)
CHECK: DW_AT_byte_size (0x01)
CHECK: NULL
CHECK: Compile Unit:
CHECK: DW_TAG_compile_unit
CHECK: DW_AT_producer ("Apple LLVM version 6.0 (clang-600.0.39) (based on LLVM 3.5svn)")
CHECK: DW_AT_name ("basic2.c")
CHECK: DW_AT_stmt_list (0x0000003e)
CHECK: DW_AT_comp_dir ("/Inputs")
CHECK: DW_AT_low_pc (0x0000000100000f50)
CHECK: DW_TAG_variable
CHECK: DW_AT_name ("private_int")
CHECK: DW_AT_type (0x0000000000000063
CHECK: DW_AT_decl_file ("/Inputs{{[/\\]}}basic2.c")
CHECK: DW_AT_location (DW_OP_addr 0x100001008)
CHECK: DW_TAG_variable
CHECK: DW_AT_name ("baz")
CHECK: DW_AT_type (0x0000000000000063
CHECK: DW_AT_location (DW_OP_addr 0x100001000)
CHECK: DW_TAG_subprogram
CHECK: DW_AT_name ("foo")
CHECK: DW_AT_type (0x0000000000000063
CHECK: DW_AT_low_pc (0x0000000100000f50)
CHECK: DW_AT_high_pc (0x0000000100000f89)
CHECK: DW_AT_frame_base (DW_OP_reg6 RBP)
CHECK: DW_TAG_formal_parameter
CHECK: DW_AT_name ("arg")
CHECK: DW_AT_type (0x0000000000000063
CHECK: DW_AT_location (0x00000000
CHECK: 0x0000000000000000 - 0x000000000000000e: DW_OP_reg5 RDI, DW_OP_piece 0x4)
CHECK: DW_TAG_inlined_subroutine
CHECK: DW_AT_abstract_origin (cu + 0x00a7 "inc")
CHECK: DW_AT_low_pc (0x0000000100000f63)
CHECK: DW_AT_high_pc (0x0000000100000f72)
CHECK: DW_AT_call_line (20)
CHECK: NULL
CHECK: DW_TAG_subprogram
CHECK: DW_AT_name ("inc")
CHECK: DW_AT_type (0x0000000000000063
CHECK: DW_AT_inline (DW_INL_inlined)
CHECK: NULL
CHECK: Compile Unit:
CHECK: DW_TAG_compile_unit
CHECK: DW_AT_producer ("Apple LLVM version 6.0 (clang-600.0.39) (based on LLVM 3.5svn)")
CHECK: DW_AT_name ("basic3.c")
CHECK: DW_AT_stmt_list (0x0000007e)
CHECK: DW_AT_comp_dir ("/Inputs")
CHECK: DW_AT_low_pc (0x0000000100000f90)
CHECK: DW_TAG_variable
CHECK: DW_AT_name ("val")
CHECK: DW_AT_type (cu + 0x003c
CHECK: DW_AT_decl_file ("/Inputs{{[/\\]}}basic3.c")
CHECK: DW_AT_location (DW_OP_addr 0x100001004)
CHECK: DW_TAG_volatile_type
CHECK: DW_AT_type (0x0000000000000063
CHECK: DW_TAG_subprogram
CHECK: DW_AT_name ("bar")
CHECK: DW_AT_type (0x0000000000000063
CHECK: DW_AT_low_pc (0x0000000100000f90)
CHECK: DW_AT_high_pc (0x0000000100000fb4)
CHECK: DW_AT_frame_base (DW_OP_reg6 RBP)
CHECK: DW_TAG_formal_parameter
CHECK: DW_AT_name ("arg")
CHECK: DW_AT_type (0x0000000000000063
CHECK: DW_AT_location (0x00000025
CHECK: 0x0000000000000000 - 0x000000000000000f: DW_OP_reg5 RDI, DW_OP_piece 0x4
CHECK: 0x0000000000000019 - 0x000000000000001d: DW_OP_reg5 RDI, DW_OP_piece 0x4)
CHECK: DW_TAG_lexical_block
CHECK: DW_AT_low_pc (0x0000000100000f94)
CHECK: DW_AT_high_pc (0x0000000100000fa7)
CHECK: DW_TAG_inlined_subroutine
CHECK: DW_AT_abstract_origin (cu + 0x009a "inc")
CHECK: DW_AT_ranges (0x00000000
CHECK: [0x0000000100000f94 - 0x0000000100000f9a)
CHECK: [0x0000000100000f9f - 0x0000000100000fa7))
CHECK: NULL
CHECK: NULL
CHECK: DW_TAG_subprogram
CHECK: DW_AT_name ("inc")
CHECK: DW_AT_type (0x0000000000000063
CHECK: NULL
CHECK: .debug_loc contents:
CHECK-NEXT: 0x00000000:
CHECK-NEXT: 0x0000000000000000 - 0x000000000000000e: DW_OP_reg5 RDI, DW_OP_piece 0x4
CHECK-NOT: :
CHECK: 0x00000025:
CHECK-NEXT: 0x0000000000000000 - 0x000000000000000f: DW_OP_reg5 RDI, DW_OP_piece 0x4
CHECK-NEXT: 0x0000000000000019 - 0x000000000000001d: DW_OP_reg5 RDI, DW_OP_piece 0x4
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: 0x0000000100000f40 23 0 1 0 0 is_stmt
CHECK: 0x0000000100000f44 24 0 1 0 0 is_stmt prologue_end
CHECK: 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: 0x0000000100000f50 19 0 1 0 0 is_stmt
CHECK: 0x0000000100000f54 20 0 1 0 0 is_stmt prologue_end
CHECK: 0x0000000100000f63 15 0 1 0 0 is_stmt
CHECK: 0x0000000100000f72 20 0 1 0 0 is_stmt
CHECK: 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: 0x0000000100000f90 16 0 1 0 0 is_stmt
CHECK: 0x0000000100000f94 12 0 1 0 0 is_stmt prologue_end
CHECK: 0x0000000100000f9a 17 0 1 0 0 is_stmt
CHECK: 0x0000000100000f9f 12 0 1 0 0 is_stmt
CHECK: 0x0000000100000fa7 20 0 1 0 0 is_stmt
CHECK: 0x0000000100000fa9 19 0 1 0 0 is_stmt
CHECK: 0x0000000100000fb2 20 0 1 0 0 is_stmt
CHECK: 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"

View File

@@ -1,10 +0,0 @@
RUN: llvm-dsymutil -f -o - -oso-prepend-path=%p/.. %p/../Inputs/basic-with-libfat-test.macho.x86_64 | llvm-dwarfdump - | FileCheck %s
The test binary was created by force-linking the libfat-test.a fat archive
with the basic linking test archive, like so:
$ clang -all_load libfat-test.a libbasic.a basic1.macho.x86_64.o -Wl,-dead_strip -u _x86_64_var
CHECK: DW_AT_name{{.*}}"x86_64_var"
CHECK: DW_AT_name{{.*}}"basic2.c"
CHECK: DW_AT_name{{.*}}"basic3.c"
CHECK: DW_AT_name{{.*}}"basic1.c"

View File

@@ -1,24 +0,0 @@
RUN: llvm-dsymutil -oso-prepend-path %p/.. %p/../Inputs/common.macho.x86_64 -f -o - | llvm-dwarfdump -v -debug-info - | FileCheck %s
The test was compiled from a single source:
$ cat common.c
char common[16];
int main() { return 0;}
void bar() {}
$ clang -g -c common.c -o common.macho.x86_64.o
$ clang common.macho.x86_64.o -o common.macho.x86_64
CHECK: DW_TAG_variable
CHECK: DW_AT_name {{.*}} "common"
CHECK-NOT: {{NULL|DW_TAG}}
CHECK: DW_AT_location {{.*}} (DW_OP_addr 0x100001000)
CHECK: DW_TAG_subprogram
CHECK-NEXT: DW_AT_low_pc{{.*}}(0x0000000100000f80)
CHECK-NOT: {{NULL|DW_TAG}}
CHECK: DW_AT_name {{.*}} "main"
CHECK: DW_TAG_subprogram
CHECK-NEXT: DW_AT_low_pc{{.*}}(0x0000000100000f90)
CHECK-NOT: {{NULL|DW_TAG}}
CHECK: DW_AT_name {{.*}} "bar"

View File

@@ -1,40 +0,0 @@
# RUN: llvm-dsymutil -oso-prepend-path %p/../Inputs -y %s -f -o - | llvm-dwarfdump - --debug-line | FileCheck %s
# This test runs dsymutil on an object file with non-standard (as far
# as llvm is concerned) line table settings.
---
triple: 'x86_64-apple-darwin'
objects:
- filename: basic2-custom-linetable.macho.x86_64.o
symbols:
- { sym: _foo, objAddr: 0x0, binAddr: 0x1000, size: 0x12 }
# CHECK: 0x0000000000001000 19 0 {{.*}} is_stmt
# CHECK: 0x0000000000001012 20 14 {{.*}} is_stmt prologue_end
# CHECK: 0x0000000000001015 20 18 {{.*}}
# CHECK: 0x0000000000001017 20 17 {{.*}}
# CHECK: 0x0000000000001019 20 10 {{.*}}
# CHECK: 0x000000000000101e 20 25 {{.*}}
# CHECK: 0x0000000000001026 20 23 {{.*}}
# CHECK: 0x000000000000102b 20 36 {{.*}}
# CHECK: 0x000000000000103c 20 31 {{.*}}
# CHECK: 0x000000000000103e 20 3 {{.*}}
# CHECK: 0x0000000000001046 20 3 {{.*}} end_sequence
- { sym: _inc, objAddr: 0x0, binAddr: 0x2000, size: 0x12 }
# CHECK: 0x0000000000002000 14 0 {{.*}} is_stmt
# CHECK: 0x0000000000002004 15 10 {{.*}} is_stmt prologue_end
# CHECK: 0x0000000000002013 15 3 {{.*}}
# CHECK: 0x0000000000002015 15 3 {{.*}} end_sequence
- { sym: _unused1, objAddr: 0x0, binAddr: 0x3000, size: 0x12 }
# CHECK: 0x0000000000003000 10 0 {{.*}} is_stmt
# CHECK: 0x0000000000003004 11 7 {{.*}} is_stmt prologue_end
# CHECK: 0x000000000000300e 11 3 {{.*}}
# CHECK: 0x0000000000003013 12 1 {{.*}} is_stmt
# CHECK: 0x000000000000301c 12 1 {{.*}} is_stmt end_sequence
...

View File

@@ -1,30 +0,0 @@
REQUIRES: system-darwin
RUN: rm -rf %t
RUN: mkdir -p %t/dsymdest
RUN: cat %p/../Inputs/basic.macho.x86_64 > %t/basic.macho.x86_64
RUN: cat %p/../Inputs/Info.plist > %t/Info.plist
RUN: llvm-dsymutil -oso-prepend-path=%p/.. %t/basic.macho.x86_64 -o %t/dsymdest/basic.macho.x86_64.dSYM
RUN: FileCheck %s --input-file %t/dsymdest/basic.macho.x86_64.dSYM/Contents/Info.plist
CHECK: <?xml version="1.0" encoding="UTF-8"?>
CHECK-NEXT: <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
CHECK-NEXT: <plist version="1.0">
CHECK-NEXT: <dict>
CHECK-NEXT: <key>CFBundleDevelopmentRegion</key>
CHECK-NEXT: <string>English</string>
CHECK-NEXT: <key>CFBundleIdentifier</key>
CHECK-NEXT: <string>com.apple.xcode.dsym.custom</string>
CHECK-NEXT: <key>CFBundleInfoDictionaryVersion</key>
CHECK-NEXT: <string>6.0</string>
CHECK-NEXT: <key>CFBundlePackageType</key>
CHECK-NEXT: <string>dSYM</string>
CHECK-NEXT: <key>CFBundleSignature</key>
CHECK-NEXT: <string>????</string>
CHECK-NEXT: <key>CFBundleShortVersionString</key>
CHECK-NEXT: <string>2.0</string>
CHECK-NEXT: <key>CFBundleVersion</key>
CHECK-NEXT: <string>2</string>
CHECK-NEXT: </dict>
CHECK-NEXT: </plist>

View File

@@ -1,48 +0,0 @@
// RUN: llvm-dsymutil -f -y %p/dummy-debug-map.map -oso-prepend-path %p/../Inputs/dead-stripped -o - | llvm-dwarfdump - --debug-info | FileCheck %s
// The test was compiled with:
// clang++ -O2 -g -c dead-strip.cpp -o 1.o
// The goal of the test is to exercise dsymutil's behavior in presence of
// functions/variables that have been dead-stripped by the linker but
// that are still present in the linked debug info (in this case because
// they have been DW_TAG_import'd in another namespace).
// Everything in the N namespace bellow doesn't have a debug map entry, and
// thus is considered dead (::foo() has a debug map entry, otherwse dsymutil
// would just drop the CU altogether).
namespace N {
int blah = 42;
// This is actually a dsymutil-classic bug that we reproduced
// CHECK: DW_TAG_variable
// CHECK-NOT: DW_TAG
// CHECK: DW_AT_location
__attribute__((always_inline)) int foo() { return blah; }
// CHECK: DW_TAG_subprogram
// CHECK-NOT: DW_AT_low_pc
// CHECK-NOT: DW_AT_high_pc
// CHECK: DW_AT_frame_base
// CHECK: DW_TAG_subprogram
int bar(unsigned i) {
int val = foo();
if (i)
return val + bar(i-1);
return foo();
}
// CHECK: DW_TAG_subprogram
// CHECK-NOT: DW_AT_low_pc
// CHECK-NOT: DW_AT_high_pc
// CHECK: DW_AT_frame_base
// CHECK-NOT: DW_AT_location
// CHECK-NOT: DW_AT_low_pc
// CHECK-NOT: DW_AT_high_pc
}
// CHECK: TAG_imported_module
using namespace N;
void foo() {}

View File

@@ -1,339 +0,0 @@
RUN: llvm-dsymutil -o - %p/../Inputs/basic.macho.i386 -f | llvm-readobj -file-headers -program-headers -sections -symbols - | FileCheck %s -check-prefix=CHECK -check-prefix=CHECK32
RUN: llvm-dsymutil -o - -oso-prepend-path=%p/.. %p/../Inputs/basic.macho.x86_64 -f | llvm-readobj -file-headers -program-headers -sections -symbols - | FileCheck %s -check-prefix=CHECK -check-prefix=CHECK64
This test checks that the dSYM companion binaries generated in 32 and 64 bits
are correct. The check are pretty strict (we check even the offsets and sizes
of the sections) in order to test the VM address layout algorithm. As the
debug sections are generated, this is a bit risky, but I don't expect
llvm-dsymutil's output to change much for these tiny C programs so this should
be OK.
The 32bits version doesn't have object files, thus it has basically no debug
sections.
CHECK32: Format: Mach-O 32-bit i386
CHECK32: Arch: i386
CHECK32: AddressSize: 32bit
CHECK64: Format: Mach-O 64-bit x86-64
CHECK64: Arch: x86_64
CHECK64: AddressSize: 64bit
CHECK: MachHeader {
CHECK32: Magic: Magic (0xFEEDFACE)
CHECK32: CpuType: X86 (0x7)
CHECK32: CpuSubType: CPU_SUBTYPE_I386_ALL (0x3)
CHECK64: Magic: Magic64 (0xFEEDFACF)
CHECK64: CpuType: X86-64 (0x1000007)
CHECK64: CpuSubType: CPU_SUBTYPE_X86_64_ALL (0x3)
CHECK: FileType: DWARFSymbol (0xA)
CHECK: NumOfLoadCommands: 7
CHECK: Flags [ (0x0)
CHECK: }
CHECK: Sections [
CHECK: Section {
CHECK: Name: __text
CHECK: Segment: __TEXT
CHECK32: Address: 0x1E90
CHECK32: Size: 0x11A
CHECK64: Address: 0x100000EA0
CHECK64: Size: 0x109
CHECK: Offset: 0
CHECK: Alignment: 4
CHECK: RelocationOffset: 0x0
CHECK: RelocationCount: 0
CHECK: Type: 0x0
CHECK: Attributes [ (0x800004)
CHECK: PureInstructions (0x800000)
CHECK: SomeInstructions (0x4)
CHECK: ]
CHECK: Reserved1: 0x0
CHECK: Reserved2: 0x0
CHECK: }
CHECK: Section {
CHECK: Name: __unwind_info
CHECK: Segment: __TEXT
CHECK32: Address: 0x1FAC
CHECK64: Address: 0x100000FAC
CHECK: Size: 0x48
CHECK: Offset: 0
CHECK: Alignment: 2
CHECK: RelocationOffset: 0x0
CHECK: RelocationCount: 0
CHECK: Type: 0x0
CHECK: Attributes [ (0x0)
CHECK: ]
CHECK: Reserved1: 0x0
CHECK: Reserved2: 0x0
CHECK: }
CHECK32: Section {
CHECK32: Name: __nl_symbol_ptr
CHECK32: Segment: __DATA
CHECK32: Address: 0x2000
CHECK32: Size: 0x4
CHECK32: Offset: 0
CHECK32: Alignment: 2
CHECK32: RelocationOffset: 0x0
CHECK32: RelocationCount: 0
CHECK32: Type: 0x6
CHECK32: Attributes [ (0x0)
CHECK32: ]
CHECK32: Reserved1: 0x0
CHECK32: Reserved2: 0x0
CHECK32: }
CHECK: Section {
CHECK: Name: __data
CHECK: Segment: __DATA
CHECK32: Address: 0x2004
CHECK64: Address: 0x100001000
CHECK: Size: 0x4
CHECK: Offset: 0
CHECK: Alignment: 2
CHECK: RelocationOffset: 0x0
CHECK: RelocationCount: 0
CHECK: Type: 0x0
CHECK: Attributes [ (0x0)
CHECK: ]
CHECK: Reserved1: 0x0
CHECK: Reserved2: 0x0
CHECK: }
CHECK: Section {
CHECK: Name: __common
CHECK: Segment: __DATA
CHECK32: Address: 0x2008
CHECK64: Address: 0x100001004
CHECK: Size: 0x4
CHECK: Offset: 0
CHECK: Alignment: 2
CHECK: RelocationOffset: 0x0
CHECK: RelocationCount: 0
CHECK: Type: LocReloc (0x1)
CHECK: Attributes [ (0x0)
CHECK: ]
CHECK: Reserved1: 0x0
CHECK: Reserved2: 0x0
CHECK: }
CHECK: Section {
CHECK: Name: __bss
CHECK: Segment: __DATA
CHECK32: Address: 0x200C
CHECK64: Address: 0x100001008
CHECK: Size: 0x4
CHECK: Offset: 0
CHECK: Alignment: 2
CHECK: RelocationOffset: 0x0
CHECK: RelocationCount: 0
CHECK: Type: LocReloc (0x1)
CHECK: Attributes [ (0x0)
CHECK: ]
CHECK: Reserved1: 0x0
CHECK: Reserved2: 0x0
CHECK: }
CHECK64: Section {
CHECK64: Name: __debug_line
CHECK64: Segment: __DWARF
CHECK64: Address: 0x100003000
CHECK64: Size: 0xEA
CHECK64: Offset: 8192
CHECK64: Alignment: 0
CHECK64: RelocationOffset: 0x0
CHECK64: RelocationCount: 0
CHECK64: Type: 0x0
CHECK64: Attributes [ (0x0)
CHECK64: ]
CHECK64: Reserved1: 0x0
CHECK64: Reserved2: 0x0
CHECK64: }
CHECK64: Section {
CHECK64: Name: __debug_pubnames
CHECK64: Segment: __DWARF
CHECK64: Address: 0x1000030EA
CHECK64: Size: 0x7F
CHECK64: Offset: 8426
CHECK64: Alignment: 0
CHECK64: RelocationOffset: 0x0
CHECK64: RelocationCount: 0
CHECK64: Type: 0x0
CHECK64: Attributes [ (0x0)
CHECK64: ]
CHECK64: Reserved1: 0x0
CHECK64: Reserved2: 0x0
CHECK64: }
CHECK64: Section {
CHECK64: Name: __debug_pubtypes
CHECK64: Segment: __DWARF
CHECK64: Address: 0x100003169
CHECK64: Size: 0x57
CHECK64: Offset: 8553
CHECK64: Alignment: 0
CHECK64: RelocationOffset: 0x0
CHECK64: RelocationCount: 0
CHECK64: Type: 0x0
CHECK64: Attributes [ (0x0)
CHECK64: ]
CHECK64: Reserved1: 0x0
CHECK64: Reserved2: 0x0
CHECK64: }
CHECK64: Section {
CHECK64: Name: __debug_aranges
CHECK64: Segment: __DWARF
CHECK64: Address: 0x1000031C0
CHECK64: Size: 0xB0
CHECK64: Offset: 8640
CHECK64: Alignment: 0
CHECK64: RelocationOffset: 0x0
CHECK64: RelocationCount: 0
CHECK64: Type: 0x0
CHECK64: Attributes [ (0x0)
CHECK64: ]
CHECK64: Reserved1: 0x0
CHECK64: Reserved2: 0x0
CHECK64: }
CHECK64: Section {
CHECK64: Name: __debug_info
CHECK64: Segment: __DWARF
CHECK64: Address: 0x100003270
CHECK64: Size: 0x1BC
CHECK64: Offset: 8816
CHECK64: Alignment: 0
CHECK64: RelocationOffset: 0x0
CHECK64: RelocationCount: 0
CHECK64: Type: 0x0
CHECK64: Attributes [ (0x0)
CHECK64: ]
CHECK64: Reserved1: 0x0
CHECK64: Reserved2: 0x0
CHECK64: }
CHECK: Section {
CHECK: Name: __debug_abbrev
CHECK: Segment: __DWARF
CHECK32: Address: 0x4000
CHECK32: Size: 0x1
CHECK32: Offset: 8192
CHECK64: Address: 0x10000342C
CHECK64: Size: 0x8F
CHECK64: Offset: 9260
CHECK: Alignment: 0
CHECK: RelocationOffset: 0x0
CHECK: RelocationCount: 0
CHECK: Type: 0x0
CHECK: Attributes [ (0x0)
CHECK: ]
CHECK: Reserved1: 0x0
CHECK: Reserved2: 0x0
CHECK: }
CHECK: Section {
CHECK: Name: __debug_str
CHECK: Segment: __DWARF
CHECK32: Address: 0x4001
CHECK32: Size: 0x1
CHECK32: Offset: 8193
CHECK64: Address: 0x1000034BB
CHECK64: Size: 0x9F
CHECK64: Offset: 9403
CHECK: Alignment: 0
CHECK: RelocationOffset: 0x0
CHECK: RelocationCount: 0
CHECK: Type: 0x0
CHECK: Attributes [ (0x0)
CHECK: ]
CHECK: Reserved1: 0x0
CHECK: Reserved2: 0x0
CHECK: }
CHECK: ]
CHECK: Symbols [
CHECK: Symbol {
CHECK: Name: _inc (2)
CHECK: Type: Section (0xE)
CHECK: Section: __text
CHECK: RefType: UndefinedNonLazy (0x0)
CHECK: Flags [ (0x0)
CHECK: ]
CHECK32: Value: 0x1F20
CHECK64: Value: 0x100000F20
CHECK: }
CHECK: Symbol {
CHECK: Name: _inc (2)
CHECK: Type: Section (0xE)
CHECK: Section: __text
CHECK: RefType: UndefinedNonLazy (0x0)
CHECK: Flags [ (0x0)
CHECK: ]
CHECK32: Value: 0x1F90
CHECK64: Value: 0x100000F90
CHECK: }
CHECK: Symbol {
CHECK: Name: _baz (7)
CHECK: Type: Section (0xE)
CHECK: Section: __data
CHECK: RefType: UndefinedNonLazy (0x0)
CHECK: Flags [ (0x0)
CHECK: ]
CHECK32: Value: 0x2004
CHECK64: Value: 0x100001000
CHECK: }
CHECK: Symbol {
CHECK: Name: _private_int (12)
CHECK: Type: Section (0xE)
CHECK: Section: __bss
CHECK: RefType: UndefinedNonLazy (0x0)
CHECK: Flags [ (0x0)
CHECK: ]
CHECK32: Value: 0x200C
CHECK64: Value: 0x100001008
CHECK: }
CHECK: Symbol {
CHECK: Name: __mh_execute_header (25)
CHECK: Extern
CHECK: Type: Section (0xE)
CHECK: Section: __text
CHECK: RefType: UndefinedNonLazy (0x0)
CHECK: Flags [ (0x10)
CHECK: ReferencedDynamically (0x10)
CHECK: ]
CHECK32: Value: 0x1000
CHECK64: Value: 0x100000000
CHECK: }
CHECK: Symbol {
CHECK: Name: _bar (45)
CHECK: Extern
CHECK: Type: Section (0xE)
CHECK: Section: __text
CHECK: RefType: UndefinedNonLazy (0x0)
CHECK: Flags [ (0x0)
CHECK: ]
CHECK32: Value: 0x1F40
CHECK64: Value: 0x100000F40
CHECK: }
CHECK: Symbol {
CHECK: Name: _foo (50)
CHECK: Extern
CHECK: Type: Section (0xE)
CHECK: Section: __text
CHECK: RefType: UndefinedNonLazy (0x0)
CHECK: Flags [ (0x0)
CHECK: ]
CHECK32: Value: 0x1EC0
CHECK64: Value: 0x100000ED0
CHECK: }
CHECK: Symbol {
CHECK: Name: _main (55)
CHECK: Extern
CHECK: Type: Section (0xE)
CHECK: Section: __text
CHECK: RefType: UndefinedNonLazy (0x0)
CHECK: Flags [ (0x0)
CHECK: ]
CHECK32: Value: 0x1E90
CHECK64: Value: 0x100000EA0
CHECK: }
CHECK: Symbol {
CHECK: Name: _val (61)
CHECK: Extern
CHECK: Type: Section (0xE)
CHECK: Section: __common
CHECK: RefType: UndefinedNonLazy (0x0)
CHECK: Flags [ (0x0)
CHECK: ]
CHECK32: Value: 0x2008
CHECK64: Value: 0x100001004
CHECK: }
CHECK: ]

View File

@@ -1,22 +0,0 @@
# This is a dummy debug map used for some tests where the contents of the
# map are just an implementation detail. The tests wanting to use that file
# should put all there object files in an explicitely named sub-directory
# of Inputs, and they should be named 1.o, 2.o, ...
# As not finding an object file or symbols isn't a fatal error for dsymutil,
# you can extend this file with as much object files and symbols as needed.
---
triple: 'x86_64-apple-darwin'
objects:
- filename: 1.o
symbols:
- { sym: __Z3foov, objAddr: 0x0, binAddr: 0x10000, size: 0x10 }
- filename: 2.o
symbols:
- { sym: __Z3foov, objAddr: 0x0, binAddr: 0x20000, size: 0x10 }
- filename: 3.o
symbols:
- { sym: __Z3foov, objAddr: 0x0, binAddr: 0x30000, size: 0x10 }
- { sym: __ZN1S3bazIiEEvT_, objAddr: 0x0, binAddr: 0x30010, size: 0x10 }
...

View File

@@ -1,23 +0,0 @@
# RUN: llvm-dsymutil -f -oso-prepend-path=%p/../Inputs/ -y %s -o - | llvm-dwarfdump -debug-line - | FileCheck %s
# Source:
# int main() {
# return 0;
# }
# Compile with:
# clang -gdwarf-4 dwarf4.c -c -o dwarf4.o
---
triple: 'x86_64-apple-darwin'
objects:
- filename: dwarf4.o
timestamp: 1513021112
symbols:
- { sym: _main, objAddr: 0x0000000000000000, binAddr: 0x0000000100000FA0, size: 0x0000000F }
...
# CHECK: .debug_line contents:
# CHECK: debug_line
# CHECK: Line table prologue:
# CHECK: total_length:
# CHECK: version: 4

View File

@@ -1,23 +0,0 @@
# RUN: llvm-dsymutil -f -oso-prepend-path=%p/../Inputs/ -y %s -o - | llvm-dwarfdump -debug-line - | FileCheck %s
# Source:
# int main() {
# return 0;
# }
# Compile with:
# clang -gdwarf-5 dwarf5.c -c -o dwarf5.o
---
triple: 'x86_64-apple-darwin'
objects:
- filename: dwarf5.o
timestamp: 1513021112
symbols:
- { sym: _main, objAddr: 0x0000000000000000, binAddr: 0x0000000100000FA0, size: 0x0000000F }
...
# CHECK: .debug_line contents:
# CHECK: debug_line
# CHECK: Line table prologue:
# CHECK: total_length:
# CHECK: version: 5

View File

@@ -1,61 +0,0 @@
# This test verifies that an empty range list in the .debug_ranges section
# doesn't crash llvm-dsymutil. As clang does not produce this kind of debug
# info anymore, we used this hand-crafted assembly file to produce a testcase
# Compile with:
# llvm-mc -triple x86_64-apple-darwin -filetype=obj -o 1.o empty_range.o
# RUN: llvm-dsymutil -f -y %p/dummy-debug-map.map -oso-prepend-path %p/../Inputs/empty_range -o - | llvm-dwarfdump -debug-info - | FileCheck %s
.section __TEXT,__text,regular,pure_instructions
.macosx_version_min 10, 11
.globl __Z3foov
.align 4, 0x90
__Z3foov: ## @_Z3foov
Lfunc_begin0:
pushq %rbp
movq %rsp, %rbp
popq %rbp
retq
Lfunc_end0:
.section __DWARF,__debug_abbrev,regular,debug
Lsection_abbrev:
.byte 1 ## Abbreviation Code
.byte 17 ## DW_TAG_compile_unit
.byte 1 ## DW_CHILDREN_yes
.byte 0 ## EOM(1)
.byte 0 ## EOM(2)
.byte 2 ## Abbreviation Code
.byte 46 ## DW_TAG_subprogram
.byte 0 ## DW_CHILDREN_no
.byte 17 ## DW_AT_low_pc
.byte 1 ## DW_FORM_addr
.byte 0x55 ## DW_AT_ranges
.byte 6 ## DW_FORM_data4
.byte 0 ## EOM(1)
.byte 0 ## EOM(2)
.byte 0 ## EOM(3)
.section __DWARF,__debug_info,regular,debug
Lsection_info:
.long 22 ## Length of Unit
.short 2 ## DWARF version number
.long 0 ## Offset Into Abbrev. Section
.byte 8 ## Address Size (in bytes)
.byte 1 ## Abbrev [1] DW_TAG_compile_unit
.byte 2 ## Abbrev [2] DW_TAG_subprogram
.quad Lfunc_begin0 ## DW_AT_low_pc
.long 0 ## DW_AT_ranges (pointing at an empty entry)
.byte 0 ## End Of Children Mark
.section __DWARF,__debug_ranges,regular,debug
Ldebug_range:
.long 0
.long 0
# CHECK: DW_TAG_compile_unit
# CHECK: DW_TAG_subprogram
# CHECK-NEXT: DW_AT_low_pc{{.*}}(0x0000000000010000)
# CHECK-NEXT: DW_AT_ranges{{.*}}(0x00000000)
# There was a bug that would use the currently active object file when a
# debug map object isn't found. Check that we only linked one file.
# CHECK-NOT: DW_TAG_compile_unit

View File

@@ -1,16 +0,0 @@
# REQUIRES: object-emission
# RUN: llvm-dsymutil -f -oso-prepend-path=%p/../Inputs -y %s -o - | llvm-dwarfdump -debug-info - | FileCheck %s
---
triple: 'i386-apple-darwin'
objects:
- filename: libfat-test.a(fat-test.o)
symbols:
- { sym: _i386_var, objAddr: 0x0, binAddr: 0x1000, size: 0x4 }
...
# CHECK: .debug_info contents:
# CHECK: DW_TAG_variable
# CHECK-NOT: {{DW_TAG|NULL}}
# CHECK: DW_AT_name{{.*}}"i386_var"

View File

@@ -1,16 +0,0 @@
# REQUIRES: object-emission
# RUN: llvm-dsymutil -f -oso-prepend-path=%p/../Inputs -y %s -o - | llvm-dwarfdump -debug-info - | FileCheck %s
---
triple: 'x86_64-apple-darwin'
objects:
- filename: fat-test.o
symbols:
- { sym: _x86_64_var, objAddr: 0x0, binAddr: 0x1000, size: 0x4 }
...
# CHECK: .debug_info contents:
# CHECK: DW_TAG_variable
# CHECK-NOT: {{DW_TAG|NULL}}
# CHECK: DW_AT_name{{.*}}"x86_64_var"

View File

@@ -1,16 +0,0 @@
# REQUIRES: object-emission
# RUN: llvm-dsymutil -f -oso-prepend-path=%p/../Inputs -y %s -o - | llvm-dwarfdump -debug-info - | FileCheck %s
---
triple: 'x86_64h-apple-darwin'
objects:
- filename: fat-test.o
symbols:
- { sym: _x86_64h_var, objAddr: 0x0, binAddr: 0x1000, size: 0x4 }
...
# CHECK: .debug_info contents:
# CHECK: DW_TAG_variable
# CHECK-NOT: {{DW_TAG|NULL}}
# CHECK: DW_AT_name{{.*}}"x86_64h_var"

View File

@@ -1,32 +0,0 @@
# REQUIRES: object-emission
# RUN: rm -rf %t
# RUN: mkdir -p %t
# RUN: llc -filetype=obj %p/../Inputs/frame-dw2.ll -o %t/frame-dw2.o
# RUN: llvm-dsymutil -f -oso-prepend-path=%t -y %s -o - | llvm-dwarfdump -debug-frame - | FileCheck %s
# This test is meant to verify that identical CIEs will get reused
# in the same file but also inbetween files. For this to happen, we
# link twice the same file using this made-up debug map:
---
triple: 'i386-apple-darwin'
objects:
- filename: frame-dw2.o
symbols:
- { sym: _bar, objAddr: 0x0, binAddr: 0x1000, size: 0x12 }
- { sym: _baz, objAddr: 0x0, binAddr: 0x2000, size: 0x12 }
- filename: frame-dw2.o
symbols:
- { sym: _baz, objAddr: 0x0, binAddr: 0x3000, size: 0x12 }
...
# CHECK: .debug_frame contents:
# CHECK: 00000000 {{[0-9a-f]*}} ffffffff CIE
# CHECK-NOT: FDE
# CHECK: FDE cie=00000000 pc=00001000...00001
# CHECK-NOT: FDE
# CHECK: FDE cie=00000000 pc=00002000...00002
# CHECK-NOT: FDE
# CHECK: FDE cie=00000000 pc=00003000...00003
# CHECK-NOT: FDE
# CHECK: .eh_frame contents:

View File

@@ -1,47 +0,0 @@
# REQUIRES: object-emission
# RUN: rm -rf %t
# RUN: mkdir -p %t
# RUN: llc -filetype=obj %p/../Inputs/frame-dw2.ll -o %t/frame-dw2.o
# RUN: llc -filetype=obj %p/../Inputs/frame-dw4.ll -o %t/frame-dw4.o
# RUN: llvm-dsymutil -f -oso-prepend-path=%t -y %s -o - | llvm-dwarfdump -debug-frame - | FileCheck %s
# Check the handling of multiple different CIEs. To have CIEs that
# appear to be different, use a dwarf2 version of the file along with
# a dwarf 4 version. The CIE header version (and layout) will be different.
# FIXME: this test also checks that we didn't reuse the first CIE when it
# appears again. This is a behavior we inherited from dsymutil-classic
# but this should be fixed (see comment in patchFrameInfoForObject())
---
triple: 'i386-apple-darwin'
objects:
- filename: frame-dw2.o
symbols:
- { sym: _bar, objAddr: 0x0, binAddr: 0x1000, size: 0x12 }
- { sym: _baz, objAddr: 0x0, binAddr: 0x2000, size: 0x12 }
- filename: frame-dw4.o
symbols:
- { sym: _baz, objAddr: 0x0, binAddr: 0x3000, size: 0x12 }
- filename: frame-dw2.o
symbols:
- { sym: _bar, objAddr: 0x0, binAddr: 0x4000, size: 0x12 }
...
# CHECK: .debug_frame contents:
# CHECK: 00000000 {{[0-9a-f]*}} ffffffff CIE
# CHECK-NEXT: Version:{{.*}}1
# CHECK-NOT: FDE
# CHECK: FDE cie=00000000 pc=00001000...00001
# CHECK-NOT: FDE
# CHECK: FDE cie=00000000 pc=00002000...00002
# CHECK-NOT: FDE
# CHECK: [[CIEDW4:[0-9a-f]*]] 00000010 ffffffff CIE
# CHECK-NEXT: Version:{{.*}}4
# CHECK-NOT: FDE
# CHECK: FDE cie=[[CIEDW4]] pc=00003000...00003
# CHECK-NOT: FDE
# CHECK: [[CIEDW2:[0-9a-f]*]] {{[0-9a-f]*}} ffffffff CIE
# CHECK-NEXT: Version:{{.*}}1
# CHECK-NOT: FDE
# CHECK: FDE cie=[[CIEDW2]] pc=00004000...00004
# CHECK-NOT: FDE
# CHECK: .eh_frame contents:

Some files were not shown because too many files have changed in this diff Show More