summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorFrederic Riss <friss@apple.com>2015-03-07 01:25:09 +0000
committerFrederic Riss <friss@apple.com>2015-03-07 01:25:09 +0000
commit3c8e619a711504fa8eae3b38f98dc8d42cb1ae1e (patch)
tree511f9523ae12c99d28be6b8675a96ad1fc258327 /test
parent5dc2251b4e19836a8e5be42c8a4d99311a11e3d0 (diff)
[dsymutil] Apply relocations to DIE data before cloning.
Doing this gets function's low_pc and global variable's locations right in the output debug info. It also could get right other attributes that need to be relocated (in linker terms), but I don't know of any other than the address attributes. This doesn't fixup low_pc attributes in compile_unit, lexical_block or inlined subroutine, nor does it get right high_pc attributes for function. This will come in a subsequent commit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231544 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/tools/dsymutil/X86/basic-linking-x86.test14
-rw-r--r--test/tools/dsymutil/X86/basic-lto-linking-x86.test6
2 files changed, 18 insertions, 2 deletions
diff --git a/test/tools/dsymutil/X86/basic-linking-x86.test b/test/tools/dsymutil/X86/basic-linking-x86.test
index e220ea64054..de919f9bc00 100644
--- a/test/tools/dsymutil/X86/basic-linking-x86.test
+++ b/test/tools/dsymutil/X86/basic-linking-x86.test
@@ -3,8 +3,8 @@ 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
-RUN: llvm-dsymutil -o - -oso-prepend-path=%p/.. %p/../Inputs/basic-archive.macho.x86_64 | llvm-dwarfdump - | 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
@@ -24,6 +24,7 @@ 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_frame_base [DW_FORM_block1] (<0x01> 56 )
CHECK: DW_TAG_formal_parameter [3]
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000056] = "argc")
@@ -64,12 +65,16 @@ 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})
+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_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_type [DW_FORM_ref4] (cu + 0x0026 => {0x000000a7})
+CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000ed0)
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")
@@ -79,6 +84,7 @@ 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_frame_base [DW_FORM_block1] (<0x01> 56 )
CHECK: NULL
@@ -91,6 +97,8 @@ CHECK: DW_AT_comp_dir [DW_FORM_strp] ( .debug_str[0x00000049] = "/Inputs"
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})
+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]
@@ -98,6 +106,7 @@ 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_frame_base [DW_FORM_block1] (<0x01> 56 )
CHECK: DW_TAG_formal_parameter [3]
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000086] = "arg")
@@ -107,6 +116,7 @@ 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_frame_base [DW_FORM_block1] (<0x01> 56 )
CHECK: NULL
diff --git a/test/tools/dsymutil/X86/basic-lto-linking-x86.test b/test/tools/dsymutil/X86/basic-lto-linking-x86.test
index 07b067cef5e..fa128de767f 100644
--- a/test/tools/dsymutil/X86/basic-lto-linking-x86.test
+++ b/test/tools/dsymutil/X86/basic-lto-linking-x86.test
@@ -18,6 +18,7 @@ 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_frame_base [DW_FORM_block1] (<0x01> 56 )
CHECK: DW_TAG_formal_parameter [3]
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000056] = "argc")
@@ -53,12 +54,15 @@ CHECK: DW_AT_comp_dir [DW_FORM_strp] ( .debug_str[0x00000049] = "/Inputs"
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_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_frame_base [DW_FORM_block1] (<0x01> 56 )
CHECK: DW_TAG_formal_parameter [9]
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000086] = "arg")
@@ -82,11 +86,13 @@ CHECK: DW_AT_comp_dir [DW_FORM_strp] ( .debug_str[0x00000049] = "/Inputs"
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_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_frame_base [DW_FORM_block1] (<0x01> 56 )
CHECK: DW_TAG_formal_parameter [9]
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000086] = "arg")