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
6 This test check the basic Dwarf linking process through the debug dumps.
8 ================================= Simple link ================================
9 CHECK: DEBUG MAP OBJECT: {{.*}}basic1.macho.x86_64.o
10 CHECK: Input compilation unit:
11 CHECK-NEXT: TAG_compile_unit
13 CHECK: AT_name {{.*}}basic1.c
15 CHECK: DEBUG MAP OBJECT: {{.*}}basic2.macho.x86_64.o
16 CHECK: Input compilation unit:
17 CHECK-NEXT: TAG_compile_unit
19 CHECK: AT_name {{.*}}basic2.c
21 CHECK: DEBUG MAP OBJECT: {{.*}}basic3.macho.x86_64.o
22 CHECK: Input compilation unit:
23 CHECK-NEXT: TAG_compile_unit
25 CHECK: AT_name {{.*}}basic3.c
27 CHECK-NOT: Found valid debug map entry
28 CHECK: Found valid debug map entry: _main 0x0000000000000000 => 0x0000000100000ea0
29 CHECK-NEXT: Keeping subprogram DIE:
30 CHECK-NEXT: DW_TAG_subprogram
31 CHECK-NEXT: DW_AT_name{{.*}}"main"
33 CHECK: Found valid debug map entry: _private_int 0x0000000000000560 => 0x0000000100001008
34 CHECK-NEXT: Keeping variable DIE:
35 CHECK-NEXT: DW_TAG_variable
36 CHECK-NEXT: DW_AT_name {{.*}}"private_int"
37 CHECK-NOT: Found valid debug map entry
38 CHECK: Found valid debug map entry: _baz 0x0000000000000310 => 0x0000000100001000
39 CHECK-NEXT: Keeping variable DIE:
40 CHECK-NEXT: DW_TAG_variable
41 CHECK-NEXT: DW_AT_name {{.*}}"baz"
42 CHECK-NOT: Found valid debug map entry
43 CHECK: Found valid debug map entry: _foo 0x0000000000000020 => 0x0000000100000ed0
44 CHECK-NEXT: Keeping subprogram DIE:
45 CHECK-NEXT: DW_TAG_subprogram
46 CHECK-NEXT: DW_AT_name {{.*}}"foo"
47 CHECK-NOT: Found valid debug map entry
48 CHECK: Found valid debug map entry: _inc 0x0000000000000070 => 0x0000000100000f20
49 CHECK-NEXT: Keeping subprogram DIE:
50 CHECK-NEXT: DW_TAG_subprogram
51 CHECK-NEXT: DW_AT_name {{.*}}"inc"
53 CHECK-NOT: Found valid debug map entry
54 CHECK: Found valid debug map entry: _val 0xffffffffffffffff => 0x0000000100001004
55 CHECK-NEXT: Keeping variable DIE:
56 CHECK-NEXT: DW_TAG_variable
57 CHECK-NEXT: DW_AT_name {{.*}}"val"
58 CHECK-NOT: Found valid debug map entry
59 CHECK: Found valid debug map entry: _bar 0x0000000000000020 => 0x0000000100000f40
60 CHECK-NEXT: Keeping subprogram DIE:
61 CHECK-NEXT: DW_TAG_subprogram
62 CHECK-NEXT: DW_AT_name {{.*}}"bar"
63 CHECK-NOT: Found valid debug map entry
64 CHECK: Found valid debug map entry: _inc 0x0000000000000070 => 0x0000000100000f90
65 CHECK-NEXT: Keeping subprogram DIE:
66 CHECK-NEXT: DW_TAG_subprogram
67 CHECK-NEXT: DW_AT_name {{.*}}"inc")
70 ================================= LTO link ================================
71 CHECK-LTO: DEBUG MAP OBJECT: {{.*}}basic-lto.macho.x86_64.o
72 CHECK-LTO: Input compilation unit:
73 CHECK-LTO-NEXT: TAG_compile_unit
75 CHECK-LTO: AT_name {{.*}}basic1.c
76 CHECK-LTO: Input compilation unit:
77 CHECK-LTO-NEXT: TAG_compile_unit
79 CHECK-LTO: AT_name {{.*}}basic2.c
80 CHECK-LTO: Input compilation unit:
81 CHECK-LTO-NEXT: TAG_compile_unit
83 CHECK-LTO: AT_name {{.*}}basic3.c
85 CHECK-LTO-NOT: Found valid debug map entry
86 CHECK-LTO: Found valid debug map entry: _main 0x0000000000000000 => 0x0000000100000f40
87 CHECK-LTO-NEXT: Keeping subprogram DIE:
88 CHECK-LTO-NEXT: DW_TAG_subprogram
89 CHECK-LTO-NEXT: DW_AT_name {{.*}}"main"
90 CHECK-LTO-NOT: Found valid debug map entry
91 CHECK-LTO: Found valid debug map entry: _private_int 0x00000000000008e8 => 0x0000000100001008
92 CHECK-LTO-NEXT: Keeping variable DIE:
93 CHECK-LTO-NEXT: DW_TAG_variable
94 CHECK-LTO-NEXT: DW_AT_name {{.*}}"private_int"
95 CHECK-LTO-NOT: Found valid debug map entry
96 CHECK-LTO: Found valid debug map entry: _baz 0x0000000000000658 => 0x0000000100001000
97 CHECK-LTO-NEXT: Keeping variable DIE:
98 CHECK-LTO-NEXT: DW_TAG_variable
99 CHECK-LTO-NEXT: DW_AT_name {{.*}} "baz"
100 CHECK-LTO-NOT: Found valid debug map entry
101 CHECK-LTO: Found valid debug map entry: _foo 0x0000000000000010 => 0x0000000100000f50
102 CHECK-LTO-NEXT: Keeping subprogram DIE:
103 CHECK-LTO-NEXT: DW_TAG_subprogram
104 CHECK-LTO-NEXT: DW_AT_name {{.*}}"foo"
105 CHECK-LTO-NOT: Found valid debug map entry
106 CHECK-LTO: Found valid debug map entry: _val 0x00000000000008ec => 0x0000000100001004
107 CHECK-LTO-NEXT: Keeping variable DIE:
108 CHECK-LTO-NEXT: DW_TAG_variable
109 CHECK-LTO-NEXT: DW_AT_name {{.*}}"val"
110 CHECK-LTO-NOT: Found valid debug map entry
111 CHECK-LTO: Found valid debug map entry: _bar 0x0000000000000050 => 0x0000000100000f90
112 CHECK-LTO-NEXT: Keeping subprogram DIE:
113 CHECK-LTO-NEXT: DW_TAG_subprogram
114 CHECK-LTO-NEXT: DW_AT_name {{.*}}"bar"
117 ================================= Archive link ================================
118 CHECK-ARCHIVE: DEBUG MAP OBJECT: {{.*}}basic1.macho.x86_64.o
119 CHECK-ARCHIVE: Input compilation unit:
120 CHECK-ARCHIVE-NEXT: TAG_compile_unit
121 CHECK-ARCHIVE-NOT: TAG
122 CHECK-ARCHIVE: AT_name {{.*}}basic1.c
124 CHECK-ARCHIVE: DEBUG MAP OBJECT: {{.*}}libbasic.a(basic2.macho.x86_64.o)
125 CHECK-ARCHIVE: Input compilation unit:
126 CHECK-ARCHIVE-NEXT: TAG_compile_unit
127 CHECK-ARCHIVE-NOT: TAG
128 CHECK-ARCHIVE: AT_name {{.*}}basic2.c
130 CHECK-ARCHIVE: DEBUG MAP OBJECT: {{.*}}libbasic.a(basic3.macho.x86_64.o)
131 CHECK-ARCHIVE: Input compilation unit:
132 CHECK-ARCHIVE-NEXT: TAG_compile_unit
133 CHECK-ARCHIVE-NOT: TAG
134 CHECK-ARCHIVE: AT_name {{.*}}basic3.c
136 CHECK-ARCHIVE-NOT: Found valid debug map entry
137 CHECK-ARCHIVE: Found valid debug map entry: _main 0x0000000000000000 => 0x0000000100000ea0
138 CHECK-ARCHIVE-NEXT: Keeping subprogram DIE:
139 CHECK-ARCHIVE-NEXT: DW_TAG_subprogram
140 CHECK-ARCHIVE-NEXT: DW_AT_name{{.*}}"main"
142 CHECK-ARCHIVE-NOT: Found valid debug map entry
143 CHECK-ARCHIVE: Found valid debug map entry: _private_int 0x0000000000000560 => 0x0000000100001004
144 CHECK-ARCHIVE-NEXT: Keeping variable DIE:
145 CHECK-ARCHIVE-NEXT: DW_TAG_variable
146 CHECK-ARCHIVE-NEXT: DW_AT_name {{.*}}"private_int"
147 CHECK-ARCHIVE-NOT: Found valid debug map entry
148 CHECK-ARCHIVE: Found valid debug map entry: _baz 0x0000000000000310 => 0x0000000100001000
149 CHECK-ARCHIVE-NEXT: Keeping variable DIE:
150 CHECK-ARCHIVE-NEXT: DW_TAG_variable
151 CHECK-ARCHIVE-NEXT: DW_AT_name {{.*}}"baz"
152 CHECK-ARCHIVE-NOT: Found valid debug map entry
153 CHECK-ARCHIVE: Found valid debug map entry: _foo 0x0000000000000020 => 0x0000000100000ed0
154 CHECK-ARCHIVE-NEXT: Keeping subprogram DIE:
155 CHECK-ARCHIVE-NEXT: DW_TAG_subprogram
156 CHECK-ARCHIVE-NEXT: DW_AT_name {{.*}}"foo"
157 CHECK-ARCHIVE-NOT: Found valid debug map entry
158 CHECK-ARCHIVE: Found valid debug map entry: _inc 0x0000000000000070 => 0x0000000100000f20
159 CHECK-ARCHIVE-NEXT: Keeping subprogram DIE:
160 CHECK-ARCHIVE-NEXT: DW_TAG_subprogram
161 CHECK-ARCHIVE-NEXT: DW_AT_name {{.*}}"inc"
163 CHECK-ARCHIVE-NOT: Found valid debug map entry
164 CHECK-ARCHIVE: Found valid debug map entry: _val 0xffffffffffffffff => 0x0000000100001008
165 CHECK-ARCHIVE-NEXT: Keeping variable DIE:
166 CHECK-ARCHIVE-NEXT: DW_TAG_variable
167 CHECK-ARCHIVE-NEXT: DW_AT_name {{.*}}"val"
168 CHECK-ARCHIVE-NOT: Found valid debug map entry
169 CHECK-ARCHIVE: Found valid debug map entry: _bar 0x0000000000000020 => 0x0000000100000f40
170 CHECK-ARCHIVE-NEXT: Keeping subprogram DIE:
171 CHECK-ARCHIVE-NEXT: DW_TAG_subprogram
172 CHECK-ARCHIVE-NEXT: DW_AT_name {{.*}}"bar"
173 CHECK-ARCHIVE-NOT: Found valid debug map entry
174 CHECK-ARCHIVE: Found valid debug map entry: _inc 0x0000000000000070 => 0x0000000100000f90
175 CHECK-ARCHIVE-NEXT: Keeping subprogram DIE:
176 CHECK-ARCHIVE-NEXT: DW_TAG_subprogram
177 CHECK-ARCHIVE-NEXT: DW_AT_name {{.*}}"inc")