AMDGPU: Allow f16/bf16 for DS_READ_TR16_B64 gfx950 builtins (#118297)
[llvm-project.git] / llvm / test / tools / dsymutil / basic-linking.test
blob1e8027d05b3c32739866ad641285ff8536a86a85
1 RUN: dsymutil -no-output -verbose -oso-prepend-path=%p %p/Inputs/basic.macho.x86_64 | FileCheck %s
2 RUN: dsymutil -no-output -verbose -oso-prepend-path=%p %p/Inputs/basic-lto.macho.x86_64 | FileCheck %s --check-prefix=CHECK-LTO
3 RUN: dsymutil -no-output -verbose -oso-prepend-path=%p %p/Inputs/basic-archive.macho.x86_64 | FileCheck %s --check-prefix=CHECK-ARCHIVE
4 RUN: dsymutil -no-output -verbose -oso-prepend-path=%p %p/Inputs/basic.macho.x86_64 %p/Inputs/basic-lto.macho.x86_64 %p/Inputs/basic-archive.macho.x86_64 | FileCheck %s --check-prefixes=CHECK,CHECK-LTO,CHECK-ARCHIVE
5 RUN: dsymutil -no-output -verbose -oso-prepend-path=%p -D %p/Inputs %p/Inputs/basic-relink.macho.arm64.dylib | FileCheck %s --check-prefix=CHECK-RELINK
6 RUN: dsymutil -no-output -verbose -oso-prepend-path=%p -D %p/Inputs %p/Inputs/two-level-relink.macho.arm64.dylib | FileCheck %s --check-prefix=CHECK-RELINK-TWO
7 RUN: dsymutil -no-output -verbose -oso-prepend-path=%p -build-variant-suffix=_debug -D WrongPath -D %p/Inputs %p/Inputs/variant-relink.macho.arm64.dylib | FileCheck %s --check-prefix=CHECK-RELINK-VARIANT
9 RUN: dsymutil --linker parallel -no-output -verbose -oso-prepend-path=%p %p/Inputs/basic.macho.x86_64 | FileCheck %s
10 RUN: dsymutil --linker parallel -no-output -verbose -oso-prepend-path=%p %p/Inputs/basic-lto.macho.x86_64 | FileCheck %s --check-prefix=CHECK-LTO
11 RUN: dsymutil --linker parallel -no-output -verbose -oso-prepend-path=%p %p/Inputs/basic-archive.macho.x86_64 | FileCheck %s --check-prefix=CHECK-ARCHIVE
12 RUN: dsymutil --linker parallel -no-output -verbose -oso-prepend-path=%p %p/Inputs/basic.macho.x86_64 %p/Inputs/basic-lto.macho.x86_64 %p/Inputs/basic-archive.macho.x86_64 | FileCheck %s --check-prefixes=CHECK,CHECK-LTO,CHECK-ARCHIVE
14 This test check the basic Dwarf linking process through the debug dumps.
16 ================================= Simple link ================================
17 CHECK: DEBUG MAP OBJECT: {{.*}}basic1.macho.x86_64.o
18 CHECK: Input compilation unit:
19 CHECK-NEXT: TAG_compile_unit
20 CHECK-NOT: TAG
21 CHECK: AT_name {{.*}}basic1.c
23 CHECK: DEBUG MAP OBJECT: {{.*}}basic2.macho.x86_64.o
24 CHECK: Input compilation unit:
25 CHECK-NEXT: TAG_compile_unit
26 CHECK-NOT: TAG
27 CHECK: AT_name {{.*}}basic2.c
29 CHECK: DEBUG MAP OBJECT: {{.*}}basic3.macho.x86_64.o
30 CHECK: Input compilation unit:
31 CHECK-NEXT: TAG_compile_unit
32 CHECK-NOT: TAG
33 CHECK: AT_name {{.*}}basic3.c
35 CHECK-NOT: Found valid debug map entry
36 CHECK: Found valid debug map entry: _main       0x0000000000000000 => 0x0000000100000ea0
37 CHECK-NEXT: Keeping subprogram DIE:
38 CHECK-NEXT: DW_TAG_subprogram
39 CHECK-NEXT:   DW_AT_name{{.*}}"main"
41 CHECK: Found valid debug map entry: _private_int        0x0000000000000560 => 0x0000000100001008
42 CHECK-NEXT: Keeping variable DIE:
43 CHECK-NEXT: DW_TAG_variable
44 CHECK-NEXT:   DW_AT_name {{.*}}"private_int"
45 CHECK-NOT: Found valid debug map entry
46 CHECK: Found valid debug map entry: _baz        0x0000000000000310 => 0x0000000100001000
47 CHECK-NEXT: Keeping variable DIE:
48 CHECK-NEXT: DW_TAG_variable
49 CHECK-NEXT:   DW_AT_name {{.*}}"baz"
50 CHECK-NOT: Found valid debug map entry
51 CHECK: Found valid debug map entry: _foo        0x0000000000000020 => 0x0000000100000ed0
52 CHECK-NEXT: Keeping subprogram DIE:
53 CHECK-NEXT: DW_TAG_subprogram
54 CHECK-NEXT:   DW_AT_name {{.*}}"foo"
55 CHECK-NOT: Found valid debug map entry
56 CHECK: Found valid debug map entry: _inc        0x0000000000000070 => 0x0000000100000f20
57 CHECK-NEXT: Keeping subprogram DIE:
58 CHECK-NEXT: DW_TAG_subprogram
59 CHECK-NEXT:   DW_AT_name {{.*}}"inc"
61 CHECK-NOT: Found valid debug map entry
62 CHECK: Found valid debug map entry: _val        0xffffffffffffffff => 0x0000000100001004
63 CHECK-NEXT: Keeping variable DIE:
64 CHECK-NEXT: DW_TAG_variable
65 CHECK-NEXT:   DW_AT_name {{.*}}"val"
66 CHECK-NOT: Found valid debug map entry
67 CHECK: Found valid debug map entry: _bar        0x0000000000000020 => 0x0000000100000f40
68 CHECK-NEXT: Keeping subprogram DIE:
69 CHECK-NEXT: DW_TAG_subprogram
70 CHECK-NEXT:   DW_AT_name {{.*}}"bar"
71 CHECK-NOT: Found valid debug map entry
72 CHECK: Found valid debug map entry: _inc        0x0000000000000070 => 0x0000000100000f90
73 CHECK-NEXT: Keeping subprogram DIE:
74 CHECK-NEXT: DW_TAG_subprogram
75 CHECK-NEXT:   DW_AT_name {{.*}}"inc")
78 ================================= LTO link ================================
79 CHECK-LTO: DEBUG MAP OBJECT: {{.*}}basic-lto.macho.x86_64.o
80 CHECK-LTO: Input compilation unit:
81 CHECK-LTO-NEXT: TAG_compile_unit
82 CHECK-LTO-NOT: TAG
83 CHECK-LTO: AT_name {{.*}}basic1.c
84 CHECK-LTO: Input compilation unit:
85 CHECK-LTO-NEXT: TAG_compile_unit
86 CHECK-LTO-NOT: TAG
87 CHECK-LTO: AT_name {{.*}}basic2.c
88 CHECK-LTO: Input compilation unit:
89 CHECK-LTO-NEXT: TAG_compile_unit
90 CHECK-LTO-NOT: TAG
91 CHECK-LTO: AT_name {{.*}}basic3.c
93 CHECK-LTO-NOT: Found valid debug map entry
94 CHECK-LTO: Found valid debug map entry: _main   0x0000000000000000 => 0x0000000100000f40
95 CHECK-LTO-NEXT: Keeping subprogram DIE:
96 CHECK-LTO-NEXT: DW_TAG_subprogram
97 CHECK-LTO-NEXT:   DW_AT_name {{.*}}"main"
98 CHECK-LTO-NOT: Found valid debug map entry
99 CHECK-LTO: Found valid debug map entry: _private_int    0x00000000000008e8 => 0x0000000100001008
100 CHECK-LTO-NEXT: Keeping variable DIE:
101 CHECK-LTO-NEXT: DW_TAG_variable
102 CHECK-LTO-NEXT:   DW_AT_name {{.*}}"private_int"
103 CHECK-LTO-NOT: Found valid debug map entry
104 CHECK-LTO: Found valid debug map entry: _baz    0x0000000000000658 => 0x0000000100001000
105 CHECK-LTO-NEXT: Keeping variable DIE:
106 CHECK-LTO-NEXT: DW_TAG_variable
107 CHECK-LTO-NEXT:   DW_AT_name {{.*}} "baz"
108 CHECK-LTO-NOT: Found valid debug map entry
109 CHECK-LTO: Found valid debug map entry: _foo    0x0000000000000010 => 0x0000000100000f50
110 CHECK-LTO-NEXT: Keeping subprogram DIE:
111 CHECK-LTO-NEXT: DW_TAG_subprogram
112 CHECK-LTO-NEXT:   DW_AT_name {{.*}}"foo"
113 CHECK-LTO-NOT: Found valid debug map entry
114 CHECK-LTO: Found valid debug map entry: _val    0x00000000000008ec => 0x0000000100001004
115 CHECK-LTO-NEXT: Keeping variable DIE:
116 CHECK-LTO-NEXT: DW_TAG_variable
117 CHECK-LTO-NEXT:   DW_AT_name {{.*}}"val"
118 CHECK-LTO-NOT: Found valid debug map entry
119 CHECK-LTO: Found valid debug map entry: _bar    0x0000000000000050 => 0x0000000100000f90
120 CHECK-LTO-NEXT: Keeping subprogram DIE:
121 CHECK-LTO-NEXT: DW_TAG_subprogram
122 CHECK-LTO-NEXT:   DW_AT_name {{.*}}"bar"
125 ================================= Archive link ================================
126 CHECK-ARCHIVE: DEBUG MAP OBJECT: {{.*}}basic1.macho.x86_64.o
127 CHECK-ARCHIVE: Input compilation unit:
128 CHECK-ARCHIVE-NEXT: TAG_compile_unit
129 CHECK-ARCHIVE-NOT: TAG
130 CHECK-ARCHIVE: AT_name {{.*}}basic1.c
132 CHECK-ARCHIVE: DEBUG MAP OBJECT: {{.*}}libbasic.a(basic2.macho.x86_64.o)
133 CHECK-ARCHIVE: Input compilation unit:
134 CHECK-ARCHIVE-NEXT: TAG_compile_unit
135 CHECK-ARCHIVE-NOT: TAG
136 CHECK-ARCHIVE: AT_name {{.*}}basic2.c
138 CHECK-ARCHIVE: DEBUG MAP OBJECT: {{.*}}libbasic.a(basic3.macho.x86_64.o)
139 CHECK-ARCHIVE: Input compilation unit:
140 CHECK-ARCHIVE-NEXT: TAG_compile_unit
141 CHECK-ARCHIVE-NOT: TAG
142 CHECK-ARCHIVE: AT_name {{.*}}basic3.c
144 CHECK-ARCHIVE-NOT: Found valid debug map entry
145 CHECK-ARCHIVE: Found valid debug map entry: _main       0x0000000000000000 => 0x0000000100000ea0
146 CHECK-ARCHIVE-NEXT: Keeping subprogram DIE:
147 CHECK-ARCHIVE-NEXT: DW_TAG_subprogram
148 CHECK-ARCHIVE-NEXT:   DW_AT_name{{.*}}"main"
150 CHECK-ARCHIVE-NOT: Found valid debug map entry
151 CHECK-ARCHIVE: Found valid debug map entry: _private_int        0x0000000000000560 => 0x0000000100001004
152 CHECK-ARCHIVE-NEXT: Keeping variable DIE:
153 CHECK-ARCHIVE-NEXT: DW_TAG_variable
154 CHECK-ARCHIVE-NEXT:   DW_AT_name {{.*}}"private_int"
155 CHECK-ARCHIVE-NOT: Found valid debug map entry
156 CHECK-ARCHIVE: Found valid debug map entry: _baz        0x0000000000000310 => 0x0000000100001000
157 CHECK-ARCHIVE-NEXT: Keeping variable DIE:
158 CHECK-ARCHIVE-NEXT: DW_TAG_variable
159 CHECK-ARCHIVE-NEXT:   DW_AT_name {{.*}}"baz"
160 CHECK-ARCHIVE-NOT: Found valid debug map entry
161 CHECK-ARCHIVE: Found valid debug map entry: _foo        0x0000000000000020 => 0x0000000100000ed0
162 CHECK-ARCHIVE-NEXT: Keeping subprogram DIE:
163 CHECK-ARCHIVE-NEXT: DW_TAG_subprogram
164 CHECK-ARCHIVE-NEXT:   DW_AT_name {{.*}}"foo"
165 CHECK-ARCHIVE-NOT: Found valid debug map entry
166 CHECK-ARCHIVE: Found valid debug map entry: _inc        0x0000000000000070 => 0x0000000100000f20
167 CHECK-ARCHIVE-NEXT: Keeping subprogram DIE:
168 CHECK-ARCHIVE-NEXT: DW_TAG_subprogram
169 CHECK-ARCHIVE-NEXT:   DW_AT_name {{.*}}"inc"
171 CHECK-ARCHIVE-NOT: Found valid debug map entry
172 CHECK-ARCHIVE: Found valid debug map entry: _val        0xffffffffffffffff => 0x0000000100001008
173 CHECK-ARCHIVE-NEXT: Keeping variable DIE:
174 CHECK-ARCHIVE-NEXT: DW_TAG_variable
175 CHECK-ARCHIVE-NEXT:   DW_AT_name {{.*}}"val"
176 CHECK-ARCHIVE-NOT: Found valid debug map entry
177 CHECK-ARCHIVE: Found valid debug map entry: _bar        0x0000000000000020 => 0x0000000100000f40
178 CHECK-ARCHIVE-NEXT: Keeping subprogram DIE:
179 CHECK-ARCHIVE-NEXT: DW_TAG_subprogram
180 CHECK-ARCHIVE-NEXT:   DW_AT_name {{.*}}"bar"
181 CHECK-ARCHIVE-NOT: Found valid debug map entry
182 CHECK-ARCHIVE: Found valid debug map entry: _inc        0x0000000000000070 => 0x0000000100000f90
183 CHECK-ARCHIVE-NEXT: Keeping subprogram DIE:
184 CHECK-ARCHIVE-NEXT: DW_TAG_subprogram
185 CHECK-ARCHIVE-NEXT:   DW_AT_name {{.*}}"inc")
188 ================================= Simple relink ================================
189 CHECK-RELINK: DEBUG MAP OBJECT: {{.*}}basic-relink.macho.arm64.o
190 CHECK-RELINK: Input compilation unit:
191 CHECK-RELINK-NEXT: TAG_compile_unit
192 CHECK-RELINK-NOT: TAG
193 CHECK-RELINK: AT_name {{.*}}basic-relink.macho.arm64.c
195 CHECK-RELINK: DEBUG MAP OBJECT: {{.*}}foo-relink.dylib
196 CHECK-RELINK: Input compilation unit:
197 CHECK-RELINK-NEXT: TAG_compile_unit
198 CHECK-RELINK-NOT: TAG
199 CHECK-RELINK: AT_name {{.*}}foo-relink.c
201 CHECK-RELINK: Input compilation unit:
202 CHECK-RELINK-NEXT: TAG_compile_unit
203 CHECK-RELINK-NOT: TAG
204 CHECK-RELINK: AT_name {{.*}}altfoo-relink.c
206 CHECK-RELINK: DEBUG MAP OBJECT: {{.*}}bar-relink.dylib
207 CHECK-RELINK: Input compilation unit:
208 CHECK-RELINK-NEXT: TAG_compile_unit
209 CHECK-RELINK-NOT: TAG
210 CHECK-RELINK: AT_name {{.*}}bar-relink.c
212 CHECK-RELINK-NOT: Found valid debug map entry
213 CHECK-RELINK: Found valid debug map entry: _display     0x0000000000000000 => 0x0000000000003f10
214 CHECK-RELINK-NEXT: Keeping subprogram DIE:
215 CHECK-RELINK-NEXT: DW_TAG_subprogram
216 CHECK-RELINK:   DW_AT_name{{.*}}"display"
218 CHECK-RELINK: Found valid debug map entry: _foo 0x0000000000003f54 => 0x0000000000003f2c
219 CHECK-RELINK-NEXT: Keeping subprogram DIE:
220 CHECK-RELINK-NEXT: DW_TAG_subprogram
221 CHECK-RELINK:   DW_AT_name {{.*}}"foo"
223 CHECK-RELINK-NOT: Found valid debug map entry
224 CHECK-RELINK: Found valid debug map entry: _foo_unused  0x0000000000003f74 => 0x0000000000003f4c
225 CHECK-RELINK-NEXT: Keeping subprogram DIE:
226 CHECK-RELINK-NEXT: DW_TAG_subprogram
227 CHECK-RELINK:   DW_AT_name {{.*}}"foo_unused"
229 CHECK-RELINK-NOT: Found valid debug map entry
230 CHECK-RELINK: Found valid debug map entry: _altfoo      0x0000000000003f7c => 0x0000000000003f54
231 CHECK-RELINK-NEXT: Keeping subprogram DIE:
232 CHECK-RELINK-NEXT: DW_TAG_subprogram
233 CHECK-RELINK:   DW_AT_name {{.*}}"altfoo"
235 CHECK-RELINK-NOT: Found valid debug map entry
236 CHECK-RELINK: Found valid debug map entry: _baz 0x0000000000004000 => 0x0000000000008000
237 CHECK-RELINK-NEXT: Keeping variable DIE:
238 CHECK-RELINK-NEXT: DW_TAG_variable
239 CHECK-RELINK-NEXT:   DW_AT_name {{.*}}"baz"
241 CHECK-RELINK-NOT: Found valid debug map entry
242 CHECK-RELINK: Found valid debug map entry: _bar 0x0000000000003fa0 => 0x0000000000003f78
243 CHECK-RELINK-NEXT: Keeping subprogram DIE:
244 CHECK-RELINK-NEXT: DW_TAG_subprogram
245 CHECK-RELINK:   DW_AT_name {{.*}}"bar"
247 ================================= Two level relink ================================
248 CHECK-RELINK-TWO: DEBUG MAP OBJECT: {{.*}}proxy-relink.dylib
249 CHECK-RELINK-TWO: Input compilation unit:
250 CHECK-RELINK-TWO-NEXT: TAG_compile_unit
251 CHECK-RELINK-TWO-NOT: TAG
252 CHECK-RELINK-TWO: AT_name {{.*}}two-level-relink.macho.arm64.c
254 CHECK-RELINK-TWO: Input compilation unit:
255 CHECK-RELINK-TWO-NEXT: TAG_compile_unit
256 CHECK-RELINK-TWO-NOT: TAG
257 CHECK-RELINK-TWO: AT_name {{.*}}bar-relink.c
258 CHECK-RELINK-TWO: DW_AT_APPLE_origin {{.*}}/path/to/bar-relink.dylib
260 CHECK-RELINK-TWO: Input compilation unit:
261 CHECK-RELINK-TWO-NEXT: TAG_compile_unit
262 CHECK-RELINK-TWO-NOT: TAG
263 CHECK-RELINK-TWO: AT_name {{.*}}foo-relink.c
264 CHECK-RELINK-TWO: DW_AT_APPLE_origin {{.*}}/path/to/foo-relink.dylib
266 CHECK-RELINK-TWO: Input compilation unit:
267 CHECK-RELINK-TWO-NEXT: TAG_compile_unit
268 CHECK-RELINK-TWO-NOT: TAG
269 CHECK-RELINK-TWO: AT_name {{.*}}altfoo-relink.c
270 CHECK-RELINK-TWO: DW_AT_APPLE_origin {{.*}}/path/to/foo-relink.dylib
272 CHECK-RELINK-TWO-NOT: Found valid debug map entry
273 CHECK-RELINK-TWO: Found valid debug map entry: _display 0x0000000000003f1c => 0x0000000000003f1c
274 CHECK-RELINK-TWO-NEXT: Keeping subprogram DIE:
275 CHECK-RELINK-TWO-NEXT: DW_TAG_subprogram
276 CHECK-RELINK-TWO:   DW_AT_name{{.*}}"display"
278 CHECK-RELINK-TWO-NOT: Found valid debug map entry
279 CHECK-RELINK-TWO: Found valid debug map entry: _baz     0x0000000000008000 => 0x0000000000008000
280 CHECK-RELINK-TWO-NEXT: Keeping variable DIE:
281 CHECK-RELINK-TWO-NEXT: DW_TAG_variable
282 CHECK-RELINK-TWO-NEXT:   DW_AT_name {{.*}}"baz"
284 CHECK-RELINK-TWO-NOT: Found valid debug map entry
285 CHECK-RELINK-TWO: Found valid debug map entry: _bar     0x0000000000003f38 => 0x0000000000003f38
286 CHECK-RELINK-TWO-NEXT: Keeping subprogram DIE:
287 CHECK-RELINK-TWO-NEXT: DW_TAG_subprogram
288 CHECK-RELINK-TWO:   DW_AT_name {{.*}}"bar"
290 CHECK-RELINK-TWO: Found valid debug map entry: _foo     0x0000000000003f40 => 0x0000000000003f40
291 CHECK-RELINK-TWO-NEXT: Keeping subprogram DIE:
292 CHECK-RELINK-TWO-NEXT: DW_TAG_subprogram
293 CHECK-RELINK-TWO:   DW_AT_name {{.*}}"foo"
295 CHECK-RELINK-TWO-NOT: Found valid debug map entry
296 CHECK-RELINK-TWO: Found valid debug map entry: _altfoo  0x0000000000003f64 => 0x0000000000003f64
297 CHECK-RELINK-TWO-NEXT: Keeping subprogram DIE:
298 CHECK-RELINK-TWO-NEXT: DW_TAG_subprogram
299 CHECK-RELINK-TWO:   DW_AT_name {{.*}}"altfoo"
301 ================================= Build variants relink ================================
302 CHECK-RELINK-VARIANT: DEBUG MAP OBJECT: {{.*}}basic-relink.macho.arm64.o
303 CHECK-RELINK-VARIANT: DEBUG MAP OBJECT: {{.*}}foo-relink-variant_debug.dylib
304 CHECK-RELINK-VARIANT: DEBUG MAP OBJECT: {{.*}}bar-relink-variant.dylib