File: basic-linking.test

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (304 lines) | stat: -rw-r--r-- 13,914 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
RUN: dsymutil -no-output -verbose -oso-prepend-path=%p %p/Inputs/basic.macho.x86_64 | FileCheck %s
RUN: dsymutil -no-output -verbose -oso-prepend-path=%p %p/Inputs/basic-lto.macho.x86_64 | FileCheck %s --check-prefix=CHECK-LTO
RUN: dsymutil -no-output -verbose -oso-prepend-path=%p %p/Inputs/basic-archive.macho.x86_64 | FileCheck %s --check-prefix=CHECK-ARCHIVE
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
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
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
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

RUN: dsymutil --linker parallel -no-output -verbose -oso-prepend-path=%p %p/Inputs/basic.macho.x86_64 | FileCheck %s
RUN: dsymutil --linker parallel -no-output -verbose -oso-prepend-path=%p %p/Inputs/basic-lto.macho.x86_64 | FileCheck %s --check-prefix=CHECK-LTO
RUN: dsymutil --linker parallel -no-output -verbose -oso-prepend-path=%p %p/Inputs/basic-archive.macho.x86_64 | FileCheck %s --check-prefix=CHECK-ARCHIVE
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

This test check the basic Dwarf linking process through the debug dumps.

================================= Simple link ================================
CHECK: DEBUG MAP OBJECT: {{.*}}basic1.macho.x86_64.o
CHECK: Input compilation unit:
CHECK-NEXT: TAG_compile_unit
CHECK-NOT: TAG
CHECK: AT_name {{.*}}basic1.c

CHECK: DEBUG MAP OBJECT: {{.*}}basic2.macho.x86_64.o
CHECK: Input compilation unit:
CHECK-NEXT: TAG_compile_unit
CHECK-NOT: TAG
CHECK: AT_name {{.*}}basic2.c

CHECK: DEBUG MAP OBJECT: {{.*}}basic3.macho.x86_64.o
CHECK: Input compilation unit:
CHECK-NEXT: TAG_compile_unit
CHECK-NOT: TAG
CHECK: AT_name {{.*}}basic3.c

CHECK-NOT: Found valid debug map entry
CHECK: Found valid debug map entry: _main	0x0000000000000000 => 0x0000000100000ea0
CHECK-NEXT: Keeping subprogram DIE:
CHECK-NEXT: DW_TAG_subprogram
CHECK-NEXT:   DW_AT_name{{.*}}"main"

CHECK: Found valid debug map entry: _private_int 	0x0000000000000560 => 0x0000000100001008
CHECK-NEXT: Keeping variable DIE:
CHECK-NEXT: DW_TAG_variable
CHECK-NEXT:   DW_AT_name {{.*}}"private_int"
CHECK-NOT: Found valid debug map entry
CHECK: Found valid debug map entry: _baz	0x0000000000000310 => 0x0000000100001000
CHECK-NEXT: Keeping variable DIE:
CHECK-NEXT: DW_TAG_variable
CHECK-NEXT:   DW_AT_name {{.*}}"baz"
CHECK-NOT: Found valid debug map entry
CHECK: Found valid debug map entry: _foo	0x0000000000000020 => 0x0000000100000ed0
CHECK-NEXT: Keeping subprogram DIE:
CHECK-NEXT: DW_TAG_subprogram
CHECK-NEXT:   DW_AT_name {{.*}}"foo"
CHECK-NOT: Found valid debug map entry
CHECK: Found valid debug map entry: _inc	0x0000000000000070 => 0x0000000100000f20
CHECK-NEXT: Keeping subprogram DIE:
CHECK-NEXT: DW_TAG_subprogram
CHECK-NEXT:   DW_AT_name {{.*}}"inc"

CHECK-NOT: Found valid debug map entry
CHECK: Found valid debug map entry: _val	0xffffffffffffffff => 0x0000000100001004
CHECK-NEXT: Keeping variable DIE:
CHECK-NEXT: DW_TAG_variable
CHECK-NEXT:   DW_AT_name {{.*}}"val"
CHECK-NOT: Found valid debug map entry
CHECK: Found valid debug map entry: _bar	0x0000000000000020 => 0x0000000100000f40
CHECK-NEXT: Keeping subprogram DIE:
CHECK-NEXT: DW_TAG_subprogram
CHECK-NEXT:   DW_AT_name {{.*}}"bar"
CHECK-NOT: Found valid debug map entry
CHECK: Found valid debug map entry: _inc	0x0000000000000070 => 0x0000000100000f90
CHECK-NEXT: Keeping subprogram DIE:
CHECK-NEXT: DW_TAG_subprogram
CHECK-NEXT:   DW_AT_name {{.*}}"inc")


================================= LTO link ================================
CHECK-LTO: DEBUG MAP OBJECT: {{.*}}basic-lto.macho.x86_64.o
CHECK-LTO: Input compilation unit:
CHECK-LTO-NEXT: TAG_compile_unit
CHECK-LTO-NOT: TAG
CHECK-LTO: AT_name {{.*}}basic1.c
CHECK-LTO: Input compilation unit:
CHECK-LTO-NEXT: TAG_compile_unit
CHECK-LTO-NOT: TAG
CHECK-LTO: AT_name {{.*}}basic2.c
CHECK-LTO: Input compilation unit:
CHECK-LTO-NEXT: TAG_compile_unit
CHECK-LTO-NOT: TAG
CHECK-LTO: AT_name {{.*}}basic3.c

CHECK-LTO-NOT: Found valid debug map entry
CHECK-LTO: Found valid debug map entry: _main	0x0000000000000000 => 0x0000000100000f40
CHECK-LTO-NEXT: Keeping subprogram DIE:
CHECK-LTO-NEXT: DW_TAG_subprogram
CHECK-LTO-NEXT:   DW_AT_name {{.*}}"main"
CHECK-LTO-NOT: Found valid debug map entry
CHECK-LTO: Found valid debug map entry: _private_int 	0x00000000000008e8 => 0x0000000100001008
CHECK-LTO-NEXT: Keeping variable DIE:
CHECK-LTO-NEXT: DW_TAG_variable
CHECK-LTO-NEXT:   DW_AT_name {{.*}}"private_int"
CHECK-LTO-NOT: Found valid debug map entry
CHECK-LTO: Found valid debug map entry: _baz	0x0000000000000658 => 0x0000000100001000
CHECK-LTO-NEXT: Keeping variable DIE:
CHECK-LTO-NEXT: DW_TAG_variable
CHECK-LTO-NEXT:   DW_AT_name {{.*}} "baz"
CHECK-LTO-NOT: Found valid debug map entry
CHECK-LTO: Found valid debug map entry: _foo	0x0000000000000010 => 0x0000000100000f50
CHECK-LTO-NEXT: Keeping subprogram DIE:
CHECK-LTO-NEXT: DW_TAG_subprogram
CHECK-LTO-NEXT:   DW_AT_name {{.*}}"foo"
CHECK-LTO-NOT: Found valid debug map entry
CHECK-LTO: Found valid debug map entry: _val	0x00000000000008ec => 0x0000000100001004
CHECK-LTO-NEXT: Keeping variable DIE:
CHECK-LTO-NEXT: DW_TAG_variable
CHECK-LTO-NEXT:   DW_AT_name {{.*}}"val"
CHECK-LTO-NOT: Found valid debug map entry
CHECK-LTO: Found valid debug map entry: _bar	0x0000000000000050 => 0x0000000100000f90
CHECK-LTO-NEXT: Keeping subprogram DIE:
CHECK-LTO-NEXT: DW_TAG_subprogram
CHECK-LTO-NEXT:   DW_AT_name {{.*}}"bar"


================================= Archive link ================================
CHECK-ARCHIVE: DEBUG MAP OBJECT: {{.*}}basic1.macho.x86_64.o
CHECK-ARCHIVE: Input compilation unit:
CHECK-ARCHIVE-NEXT: TAG_compile_unit
CHECK-ARCHIVE-NOT: TAG
CHECK-ARCHIVE: AT_name {{.*}}basic1.c

CHECK-ARCHIVE: DEBUG MAP OBJECT: {{.*}}libbasic.a(basic2.macho.x86_64.o)
CHECK-ARCHIVE: Input compilation unit:
CHECK-ARCHIVE-NEXT: TAG_compile_unit
CHECK-ARCHIVE-NOT: TAG
CHECK-ARCHIVE: AT_name {{.*}}basic2.c

CHECK-ARCHIVE: DEBUG MAP OBJECT: {{.*}}libbasic.a(basic3.macho.x86_64.o)
CHECK-ARCHIVE: Input compilation unit:
CHECK-ARCHIVE-NEXT: TAG_compile_unit
CHECK-ARCHIVE-NOT: TAG
CHECK-ARCHIVE: AT_name {{.*}}basic3.c

CHECK-ARCHIVE-NOT: Found valid debug map entry
CHECK-ARCHIVE: Found valid debug map entry: _main	0x0000000000000000 => 0x0000000100000ea0
CHECK-ARCHIVE-NEXT: Keeping subprogram DIE:
CHECK-ARCHIVE-NEXT: DW_TAG_subprogram
CHECK-ARCHIVE-NEXT:   DW_AT_name{{.*}}"main"

CHECK-ARCHIVE-NOT: Found valid debug map entry
CHECK-ARCHIVE: Found valid debug map entry: _private_int	0x0000000000000560 => 0x0000000100001004
CHECK-ARCHIVE-NEXT: Keeping variable DIE:
CHECK-ARCHIVE-NEXT: DW_TAG_variable
CHECK-ARCHIVE-NEXT:   DW_AT_name {{.*}}"private_int"
CHECK-ARCHIVE-NOT: Found valid debug map entry
CHECK-ARCHIVE: Found valid debug map entry: _baz	0x0000000000000310 => 0x0000000100001000
CHECK-ARCHIVE-NEXT: Keeping variable DIE:
CHECK-ARCHIVE-NEXT: DW_TAG_variable
CHECK-ARCHIVE-NEXT:   DW_AT_name {{.*}}"baz"
CHECK-ARCHIVE-NOT: Found valid debug map entry
CHECK-ARCHIVE: Found valid debug map entry: _foo	0x0000000000000020 => 0x0000000100000ed0
CHECK-ARCHIVE-NEXT: Keeping subprogram DIE:
CHECK-ARCHIVE-NEXT: DW_TAG_subprogram
CHECK-ARCHIVE-NEXT:   DW_AT_name {{.*}}"foo"
CHECK-ARCHIVE-NOT: Found valid debug map entry
CHECK-ARCHIVE: Found valid debug map entry: _inc	0x0000000000000070 => 0x0000000100000f20
CHECK-ARCHIVE-NEXT: Keeping subprogram DIE:
CHECK-ARCHIVE-NEXT: DW_TAG_subprogram
CHECK-ARCHIVE-NEXT:   DW_AT_name {{.*}}"inc"

CHECK-ARCHIVE-NOT: Found valid debug map entry
CHECK-ARCHIVE: Found valid debug map entry: _val	0xffffffffffffffff => 0x0000000100001008
CHECK-ARCHIVE-NEXT: Keeping variable DIE:
CHECK-ARCHIVE-NEXT: DW_TAG_variable
CHECK-ARCHIVE-NEXT:   DW_AT_name {{.*}}"val"
CHECK-ARCHIVE-NOT: Found valid debug map entry
CHECK-ARCHIVE: Found valid debug map entry: _bar	0x0000000000000020 => 0x0000000100000f40
CHECK-ARCHIVE-NEXT: Keeping subprogram DIE:
CHECK-ARCHIVE-NEXT: DW_TAG_subprogram
CHECK-ARCHIVE-NEXT:   DW_AT_name {{.*}}"bar"
CHECK-ARCHIVE-NOT: Found valid debug map entry
CHECK-ARCHIVE: Found valid debug map entry: _inc	0x0000000000000070 => 0x0000000100000f90
CHECK-ARCHIVE-NEXT: Keeping subprogram DIE:
CHECK-ARCHIVE-NEXT: DW_TAG_subprogram
CHECK-ARCHIVE-NEXT:   DW_AT_name {{.*}}"inc")


================================= Simple relink ================================
CHECK-RELINK: DEBUG MAP OBJECT: {{.*}}basic-relink.macho.arm64.o
CHECK-RELINK: Input compilation unit:
CHECK-RELINK-NEXT: TAG_compile_unit
CHECK-RELINK-NOT: TAG
CHECK-RELINK: AT_name {{.*}}basic-relink.macho.arm64.c

CHECK-RELINK: DEBUG MAP OBJECT: {{.*}}foo-relink.dylib
CHECK-RELINK: Input compilation unit:
CHECK-RELINK-NEXT: TAG_compile_unit
CHECK-RELINK-NOT: TAG
CHECK-RELINK: AT_name {{.*}}foo-relink.c

CHECK-RELINK: Input compilation unit:
CHECK-RELINK-NEXT: TAG_compile_unit
CHECK-RELINK-NOT: TAG
CHECK-RELINK: AT_name {{.*}}altfoo-relink.c

CHECK-RELINK: DEBUG MAP OBJECT: {{.*}}bar-relink.dylib
CHECK-RELINK: Input compilation unit:
CHECK-RELINK-NEXT: TAG_compile_unit
CHECK-RELINK-NOT: TAG
CHECK-RELINK: AT_name {{.*}}bar-relink.c

CHECK-RELINK-NOT: Found valid debug map entry
CHECK-RELINK: Found valid debug map entry: _display	0x0000000000000000 => 0x0000000000003f10
CHECK-RELINK-NEXT: Keeping subprogram DIE:
CHECK-RELINK-NEXT: DW_TAG_subprogram
CHECK-RELINK:   DW_AT_name{{.*}}"display"

CHECK-RELINK: Found valid debug map entry: _foo	0x0000000000003f54 => 0x0000000000003f2c
CHECK-RELINK-NEXT: Keeping subprogram DIE:
CHECK-RELINK-NEXT: DW_TAG_subprogram
CHECK-RELINK:   DW_AT_name {{.*}}"foo"

CHECK-RELINK-NOT: Found valid debug map entry
CHECK-RELINK: Found valid debug map entry: _foo_unused	0x0000000000003f74 => 0x0000000000003f4c
CHECK-RELINK-NEXT: Keeping subprogram DIE:
CHECK-RELINK-NEXT: DW_TAG_subprogram
CHECK-RELINK:   DW_AT_name {{.*}}"foo_unused"

CHECK-RELINK-NOT: Found valid debug map entry
CHECK-RELINK: Found valid debug map entry: _altfoo	0x0000000000003f7c => 0x0000000000003f54
CHECK-RELINK-NEXT: Keeping subprogram DIE:
CHECK-RELINK-NEXT: DW_TAG_subprogram
CHECK-RELINK:   DW_AT_name {{.*}}"altfoo"

CHECK-RELINK-NOT: Found valid debug map entry
CHECK-RELINK: Found valid debug map entry: _baz	0x0000000000004000 => 0x0000000000008000
CHECK-RELINK-NEXT: Keeping variable DIE:
CHECK-RELINK-NEXT: DW_TAG_variable
CHECK-RELINK-NEXT:   DW_AT_name {{.*}}"baz"

CHECK-RELINK-NOT: Found valid debug map entry
CHECK-RELINK: Found valid debug map entry: _bar	0x0000000000003fa0 => 0x0000000000003f78
CHECK-RELINK-NEXT: Keeping subprogram DIE:
CHECK-RELINK-NEXT: DW_TAG_subprogram
CHECK-RELINK:   DW_AT_name {{.*}}"bar"

================================= Two level relink ================================
CHECK-RELINK-TWO: DEBUG MAP OBJECT: {{.*}}proxy-relink.dylib
CHECK-RELINK-TWO: Input compilation unit:
CHECK-RELINK-TWO-NEXT: TAG_compile_unit
CHECK-RELINK-TWO-NOT: TAG
CHECK-RELINK-TWO: AT_name {{.*}}two-level-relink.macho.arm64.c

CHECK-RELINK-TWO: Input compilation unit:
CHECK-RELINK-TWO-NEXT: TAG_compile_unit
CHECK-RELINK-TWO-NOT: TAG
CHECK-RELINK-TWO: AT_name {{.*}}bar-relink.c
CHECK-RELINK-TWO: DW_AT_APPLE_origin {{.*}}/path/to/bar-relink.dylib

CHECK-RELINK-TWO: Input compilation unit:
CHECK-RELINK-TWO-NEXT: TAG_compile_unit
CHECK-RELINK-TWO-NOT: TAG
CHECK-RELINK-TWO: AT_name {{.*}}foo-relink.c
CHECK-RELINK-TWO: DW_AT_APPLE_origin {{.*}}/path/to/foo-relink.dylib

CHECK-RELINK-TWO: Input compilation unit:
CHECK-RELINK-TWO-NEXT: TAG_compile_unit
CHECK-RELINK-TWO-NOT: TAG
CHECK-RELINK-TWO: AT_name {{.*}}altfoo-relink.c
CHECK-RELINK-TWO: DW_AT_APPLE_origin {{.*}}/path/to/foo-relink.dylib

CHECK-RELINK-TWO-NOT: Found valid debug map entry
CHECK-RELINK-TWO: Found valid debug map entry: _display	0x0000000000003f1c => 0x0000000000003f1c
CHECK-RELINK-TWO-NEXT: Keeping subprogram DIE:
CHECK-RELINK-TWO-NEXT: DW_TAG_subprogram
CHECK-RELINK-TWO:   DW_AT_name{{.*}}"display"

CHECK-RELINK-TWO-NOT: Found valid debug map entry
CHECK-RELINK-TWO: Found valid debug map entry: _baz	0x0000000000008000 => 0x0000000000008000
CHECK-RELINK-TWO-NEXT: Keeping variable DIE:
CHECK-RELINK-TWO-NEXT: DW_TAG_variable
CHECK-RELINK-TWO-NEXT:   DW_AT_name {{.*}}"baz"

CHECK-RELINK-TWO-NOT: Found valid debug map entry
CHECK-RELINK-TWO: Found valid debug map entry: _bar	0x0000000000003f38 => 0x0000000000003f38
CHECK-RELINK-TWO-NEXT: Keeping subprogram DIE:
CHECK-RELINK-TWO-NEXT: DW_TAG_subprogram
CHECK-RELINK-TWO:   DW_AT_name {{.*}}"bar"

CHECK-RELINK-TWO: Found valid debug map entry: _foo	0x0000000000003f40 => 0x0000000000003f40
CHECK-RELINK-TWO-NEXT: Keeping subprogram DIE:
CHECK-RELINK-TWO-NEXT: DW_TAG_subprogram
CHECK-RELINK-TWO:   DW_AT_name {{.*}}"foo"

CHECK-RELINK-TWO-NOT: Found valid debug map entry
CHECK-RELINK-TWO: Found valid debug map entry: _altfoo	0x0000000000003f64 => 0x0000000000003f64
CHECK-RELINK-TWO-NEXT: Keeping subprogram DIE:
CHECK-RELINK-TWO-NEXT: DW_TAG_subprogram
CHECK-RELINK-TWO:   DW_AT_name {{.*}}"altfoo"

================================= Build variants relink ================================
CHECK-RELINK-VARIANT: DEBUG MAP OBJECT: {{.*}}basic-relink.macho.arm64.o
CHECK-RELINK-VARIANT: DEBUG MAP OBJECT: {{.*}}foo-relink-variant_debug.dylib
CHECK-RELINK-VARIANT: DEBUG MAP OBJECT: {{.*}}bar-relink-variant.dylib