1 ; This test checks to ensure that if three DWARFv5 object files have correct values for the DW_AT_addr_base in their compile units.
3 ; 1.o was produced with the source file:
6 ; __attribute__((section("1,__text_foo"))) void foo() {}
20 ; clang -g -c -O1 a.cpp -gdwarf-5 -o 1.o
22 ; 2.o was produced with the following source file:
25 ; __attribute__((section("1,__text_foo"))) void bar() {}
35 ; clang -g -c -O1 b.cpp -gdwarf-5 -o 2.o
37 ; 3.o was produced with the following source file:
45 ; clang -g -c -O1 c.cpp -gdwarf-5 -o 3.o
48 RUN: rm -rf %t.dir && mkdir -p %t.dir
49 RUN: dsymutil -y %p/dummy-debug-map-amr64.map -oso-prepend-path=%p/../Inputs/DWARF5-addr-base-str-off-base -o %t.dir/dwarf5-addr-base.dSYM
50 RUN: llvm-dwarfdump %t.dir/dwarf5-addr-base.dSYM -a --verbose | FileCheck %s
52 RUN: rm -rf %t.dir && mkdir -p %t.dir
53 RUN: dsymutil --linker parallel --no-odr -y %p/dummy-debug-map-amr64.map \
54 RUN: -oso-prepend-path=%p/../Inputs/DWARF5-addr-base-str-off-base \
55 RUN: -o %t.dir/dwarf5-addr-base.dSYM
56 RUN: llvm-dwarfdump %t.dir/dwarf5-addr-base.dSYM -a --verbose | FileCheck %s
58 RUN: rm -rf %t.dir && mkdir -p %t.dir
59 RUN: dsymutil --linker parallel -y %p/dummy-debug-map-amr64.map \
60 RUN: -oso-prepend-path=%p/../Inputs/DWARF5-addr-base-str-off-base \
61 RUN: -o %t.dir/dwarf5-addr-base.dSYM
62 RUN: llvm-dwarfdump %t.dir/dwarf5-addr-base.dSYM -a --verbose | \
63 RUN: FileCheck %s --check-prefixes=CHECK,CHECK-LLVM
66 RUN: rm -rf %t.dir && mkdir -p %t.dir
67 RUN: dsymutil --update -y %p/dummy-debug-map-amr64.map -oso-prepend-path=%p/../Inputs/DWARF5-addr-base-str-off-base -o %t.dir/dwarf5-addr-base.dSYM
68 RUN: llvm-dwarfdump %t.dir/dwarf5-addr-base.dSYM -a --verbose | FileCheck %s --check-prefix=UPD
70 RUN: rm -rf %t.dir && mkdir -p %t.dir
71 RUN: dsymutil --linker parallel --no-odr --update -y %p/dummy-debug-map-amr64.map \
72 RUN: -oso-prepend-path=%p/../Inputs/DWARF5-addr-base-str-off-base \
73 RUN: -o %t.dir/dwarf5-addr-base.dSYM
74 RUN: llvm-dwarfdump %t.dir/dwarf5-addr-base.dSYM -a --verbose | \
75 RUN: FileCheck %s --check-prefix=UPD
77 RUN: rm -rf %t.dir && mkdir -p %t.dir
78 RUN: dsymutil --linker parallel --update -y %p/dummy-debug-map-amr64.map \
79 RUN: -oso-prepend-path=%p/../Inputs/DWARF5-addr-base-str-off-base \
80 RUN: -o %t.dir/dwarf5-addr-base.dSYM
81 RUN: llvm-dwarfdump %t.dir/dwarf5-addr-base.dSYM -a --verbose | \
82 RUN: FileCheck %s --check-prefix=UPD
85 CHECK: .debug_info contents:
87 CHECK-LLVM: Compile Unit: length = 0x0000001f, format = DWARF32, version = 0x0005, unit_type = DW_UT_compile, abbr_offset = {{.*}}, addr_size = 0x08
88 CHECK-LLVM: DW_TAG_compile_unit
89 CHECK-LLVM: DW_TAG_base_type
91 CHECK: Compile Unit: length = 0x0000004a, format = DWARF32, version = 0x0005, unit_type = DW_UT_compile, abbr_offset = {{.*}}, addr_size = 0x08
93 CHECK: DW_TAG_compile_unit
94 CHECK: DW_AT_addr_base [DW_FORM_sec_offset] (0x00000008)
96 CHECK: DW_TAG_subprogram
97 CHECK-NEXT: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000000) address = 0x[[ADDR1:[0-9a-f]+]])
100 CHECK: Compile Unit: length = 0x0000004a, format = DWARF32, version = 0x0005, unit_type = DW_UT_compile, abbr_offset = {{.*}}, addr_size = 0x08
102 CHECK: DW_TAG_compile_unit
103 CHECK: DW_AT_addr_base [DW_FORM_sec_offset] (0x00000018)
105 CHECK: DW_TAG_subprogram
106 CHECK-NEXT: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000000) address = 0x[[ADDR2:[0-9a-f]+]])
108 CHECK: Compile Unit: length = 0x00000043, format = DWARF32, version = 0x0005, unit_type = DW_UT_compile, abbr_offset = {{.*}}, addr_size = 0x08
110 CHECK: DW_TAG_compile_unit
111 CHECK: DW_AT_addr_base [DW_FORM_sec_offset] (0x00000028)
113 CHECK: DW_TAG_subprogram
114 CHECK-NEXT: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000000) address = 0x[[ADDR3:[0-9a-f]+]])
116 CHECK: .debug_addr contents:
117 CHECK-NEXT: 0x00000000: Address table header: length = 0x0000000c, format = DWARF32, version = 0x0005, addr_size = 0x08, seg_size = 0x00
119 CHECK-NEXT: 0x[[ADDR1]]
121 CHECK-NEXT: 0x00000010: Address table header: length = 0x0000000c, format = DWARF32, version = 0x0005, addr_size = 0x08, seg_size = 0x00
123 CHECK-NEXT: 0x[[ADDR2]]
125 CHECK-NEXT: 0x00000020: Address table header: length = 0x0000000c, format = DWARF32, version = 0x0005, addr_size = 0x08, seg_size = 0x00
127 CHECK-NEXT: 0x[[ADDR3]]
130 UPD: .debug_info contents:
131 UPD-NEXT: 0x00000000: Compile Unit: length = 0x00000081, format = DWARF32, version = 0x0005, unit_type = DW_UT_compile, abbr_offset = 0x0000, addr_size = 0x08
133 UPD: 0x0000000c: DW_TAG_compile_unit [1] *
134 UPD: DW_AT_addr_base [DW_FORM_sec_offset] (0x00000008)
136 UPD: 0x00000031: DW_TAG_subprogram [2] (0x0000000c)
137 UPD-NEXT: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000000) address = 0x0000000000000018)
139 UPD: 0x0000003d: DW_TAG_subprogram [3] * (0x0000000c)
140 UPD-NEXT: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000001) address = 0x0000000000000000)
142 UPD: 0x00000057: DW_TAG_subprogram [3] * (0x0000000c)
143 UPD-NEXT: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000002) address = 0x0000000000000008)
145 UPD: 0x00000071: DW_TAG_subprogram [5] (0x0000000c)
146 UPD-NEXT: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000003) address = 0x0000000000000010)
149 UPD: 0x00000085: Compile Unit: length = 0x00000072, format = DWARF32, version = 0x0005, unit_type = DW_UT_compile, abbr_offset = 0x00{{00|99}}, addr_size = 0x08
151 UPD: 0x00000091: DW_TAG_compile_unit [1] *
152 UPD: DW_AT_addr_base [DW_FORM_sec_offset] (0x00000008)
154 UPD: 0x000000b6: DW_TAG_subprogram [2] (0x00000091)
155 UPD-NEXT: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000000) address = 0x0000000000000018)
157 UPD: 0x000000c2: DW_TAG_subprogram [3] * (0x00000091)
158 UPD-NEXT: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000001) address = 0x0000000000000000)
160 UPD: 0x000000dc: DW_TAG_subprogram [3] * (0x00000091)
161 UPD-NEXT: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000002) address = 0x0000000000000008)
163 UPD: 0x000000fb: Compile Unit: length = 0x00000044, format = DWARF32, version = 0x0005, unit_type = DW_UT_compile, abbr_offset = 0x0{{000|115}}, addr_size = 0x08
165 UPD: 0x00000107: DW_TAG_compile_unit {{.*}} *
166 UPD: DW_AT_addr_base [DW_FORM_sec_offset] (0x00000008)
168 UPD: 0x00000124: DW_TAG_subprogram {{.*}} * (0x00000107)
169 UPD-NEXT: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000000) address = 0x0000000000000018)
171 UPD: .debug_addr contents:
172 UPD-NEXT: 0x00000000: Address table header: length = 0x00000024, format = DWARF32, version = 0x0005, addr_size = 0x08, seg_size = 0x00
174 UPD-NEXT: 0x0000000000000018
175 UPD-NEXT: 0x0000000000000000
176 UPD-NEXT: 0x0000000000000008
177 UPD-NEXT: 0x0000000000000010
179 UPD-NEXT: 0x00000028: Address table header: length = 0x0000001c, format = DWARF32, version = 0x0005, addr_size = 0x08, seg_size = 0x00
181 UPD-NEXT: 0x0000000000000010
182 UPD-NEXT: 0x0000000000000000
183 UPD-NEXT: 0x0000000000000008
185 UPD-NEXT: 0x00000048: Address table header: length = 0x0000000c, format = DWARF32, version = 0x0005, addr_size = 0x08, seg_size = 0x00
187 UPD-NEXT: 0x0000000000000000