Follow up to d0858bffa11, add missing REQUIRES x86
[llvm-project.git] / llvm / test / tools / dsymutil / X86 / basic-linking-x86.test
blobba8d227c578ebaf01e22fc52f73601f00c1f28cb
1 RUN: cp %p/../Inputs/basic.macho.x86_64 %t1
2 RUN: dsymutil -accelerator=Pub -f -oso-prepend-path=%p/.. %t1
3 RUN: llvm-dwarfdump -a %t1.dwarf | FileCheck %s
4 RUN: dsymutil -accelerator=Pub -f -o %t2 -oso-prepend-path=%p/.. \
5 RUN:   %p/../Inputs/basic.macho.x86_64
6 RUN: llvm-dwarfdump -a %t2 | FileCheck %s
7 RUN: dsymutil -accelerator=Pub -f -o - -oso-prepend-path=%p/.. \
8 RUN:   %p/../Inputs/basic.macho.x86_64 | llvm-dwarfdump -a - | \
9 RUN:   FileCheck %s --check-prefixes=CHECK,BASIC,PUB
10 RUN: dsymutil -accelerator=Pub -f -o - -oso-prepend-path=%p/.. \
11 RUN:   %p/../Inputs/basic-archive.macho.x86_64 | llvm-dwarfdump -a - \
12 RUN:   | FileCheck %s --check-prefixes=CHECK,ARCHIVE,PUB
13 RUN: dsymutil -accelerator=Pub -dump-debug-map -oso-prepend-path=%p/.. \
14 RUN:   %p/../Inputs/basic.macho.x86_64 | dsymutil -accelerator=Pub -f -y \
15 RUN:   -o - - | llvm-dwarfdump -a - | FileCheck %s \
16 RUN:   --check-prefixes=CHECK,BASIC,PUB
17 RUN: dsymutil -accelerator=Pub -dump-debug-map -oso-prepend-path=%p/.. \
18 RUN:   %p/../Inputs/basic-archive.macho.x86_64 | dsymutil -accelerator=Pub \
19 RUN:   -f -o - -y - | llvm-dwarfdump -a - | FileCheck %s \
20 RUN:   --check-prefixes=CHECK,ARCHIVE,PUB
22 ### ---------------------------------------
23 ### Repeat the same steps for --linker llvm
25 RUN: dsymutil --linker llvm -accelerator=Pub -f -oso-prepend-path=%p/.. %t1
26 RUN: llvm-dwarfdump -a %t1.dwarf | FileCheck %s
27 RUN: dsymutil --linker llvm  -accelerator=Pub -f -o %t2 -oso-prepend-path=%p/.. \
28 RUN:   %p/../Inputs/basic.macho.x86_64
29 RUN: llvm-dwarfdump -a %t2 | FileCheck %s
30 RUN: dsymutil --linker llvm  -accelerator=Pub -f -o - -oso-prepend-path=%p/.. \
31 RUN:   %p/../Inputs/basic.macho.x86_64 | llvm-dwarfdump -a - | \
32 RUN:   FileCheck %s --check-prefixes=CHECK,BASIC,PUB
33 RUN: dsymutil --linker llvm -accelerator=Pub -f -o - -oso-prepend-path=%p/.. \
34 RUN:   %p/../Inputs/basic-archive.macho.x86_64 | llvm-dwarfdump -a - | \
35 RUN:   FileCheck %s --check-prefixes=CHECK,ARCHIVE,PUB
36 RUN: dsymutil --linker llvm -accelerator=Pub -dump-debug-map \
37 RUN:  -oso-prepend-path=%p/.. %p/../Inputs/basic.macho.x86_64 \
38 RUN:  | dsymutil -accelerator=Pub -f -y -o - - | llvm-dwarfdump \
39 RUN:  -a - | FileCheck %s --check-prefixes=CHECK,BASIC,PUB
40 RUN: dsymutil --linker llvm -accelerator=Pub -dump-debug-map \
41 RUN:   -oso-prepend-path=%p/.. %p/../Inputs/basic-archive.macho.x86_64 \
42 RUN:   | dsymutil -accelerator=Pub -f -o - -y - | llvm-dwarfdump -a - | \
43 RUN:   FileCheck %s --check-prefixes=CHECK,ARCHIVE,PUB
45 CHECK: file format Mach-O 64-bit x86-64
47 CHECK: debug_info contents
49 CHECK:  Compile Unit:
51 CHECK:  DW_TAG_compile_unit
52 CHECK:    DW_AT_producer ("Apple LLVM version 6.0 (clang-600.0.39) (based on LLVM 3.5svn)")
53 CHECK:    DW_AT_language (DW_LANG_C99)
54 CHECK:    DW_AT_name ("basic1.c")
55 CHECK:    DW_AT_stmt_list (0x00000000)
56 CHECK:    DW_AT_comp_dir ("/Inputs")
57 CHECK:    DW_AT_low_pc (0x0000000100000ea0)
58 CHECK:    DW_TAG_subprogram
59 CHECK:    DW_AT_name ("main")
60 CHECK:      DW_AT_decl_file ("/Inputs{{[/\\]}}basic1.c")
61 CHECK:      DW_AT_decl_line (23)
62 CHECK:      DW_AT_prototyped (0x01)
63 CHECK:      DW_AT_type (0x00000063
64 CHECK:      DW_AT_external (0x01)
65 CHECK:      DW_AT_accessibility (DW_ACCESS_public)
66 CHECK:      DW_AT_low_pc (0x0000000100000ea0)
67 CHECK:      DW_AT_high_pc (0x0000000100000ec4)
68 CHECK:      DW_AT_frame_base (DW_OP_reg6 RBP)
69 CHECK:      DW_TAG_formal_parameter
70 CHECK:        DW_AT_name ("argc")
71 CHECK:        DW_AT_decl_file ("/Inputs{{[/\\]}}basic1.c")
72 CHECK:        DW_AT_decl_line (23)
73 CHECK:        DW_AT_type (0x00000063
74 CHECK:        DW_AT_location (DW_OP_fbreg -8)
75 CHECK:      DW_TAG_formal_parameter
76 CHECK:        DW_AT_name ("argv")
77 CHECK:        DW_AT_decl_file ("/Inputs{{[/\\]}}basic1.c")
78 CHECK:        DW_AT_decl_line (23)
79 CHECK:        DW_AT_type (0x0000006a
80 CHECK:        DW_AT_location (DW_OP_fbreg -16)
81 CHECK:      NULL
82 CHECK:    DW_TAG_base_type
83 CHECK:      DW_AT_name ("int")
84 CHECK:      DW_AT_encoding (DW_ATE_signed)
85 CHECK:      DW_AT_byte_size (0x04)
86 CHECK:    DW_TAG_pointer_type
87 CHECK:      DW_AT_type (0x0000006f
88 CHECK:    DW_TAG_pointer_type
89 CHECK:      DW_AT_type (0x00000074
90 CHECK:    DW_TAG_const_type
91 CHECK:      DW_AT_type (0x00000079
92 CHECK:    DW_TAG_base_type
93 CHECK:      DW_AT_name ("char")
94 CHECK:      DW_AT_encoding (DW_ATE_signed_char)
95 CHECK:      DW_AT_byte_size (0x01)
96 CHECK:    NULL
98 CHECK:  Compile Unit:
100 CHECK:  DW_TAG_compile_unit
101 CHECK:   DW_AT_producer ("Apple LLVM version 6.0 (clang-600.0.39) (based on LLVM 3.5svn)")
102 CHECK:   DW_AT_name ("basic2.c")
103 CHECK:   DW_AT_stmt_list (0x0000003f)
104 CHECK:   DW_AT_comp_dir ("/Inputs")
105 CHECK:   DW_AT_low_pc (0x0000000100000ed0)
106 CHECK:    DW_TAG_base_type
107 CHECK:      DW_AT_name ("int")
108 CHECK:    DW_TAG_variable
109 CHECK:      DW_AT_name ("private_int")
110 CHECK:      DW_AT_type (0x000000a7
111 CHECK:      DW_AT_decl_file ("/Inputs{{[/\\]}}basic2.c")
112 BASIC:      DW_AT_location (DW_OP_addr 0x100001008)
113 ARCHIVE:    DW_AT_location (DW_OP_addr 0x100001004)
114 CHECK:    DW_TAG_variable
115 CHECK:      DW_AT_name ("baz")
116 CHECK:      DW_AT_type (0x000000a7
117 CHECK:      DW_AT_decl_file ("/Inputs{{[/\\]}}basic2.c")
118 CHECK:      DW_AT_location (DW_OP_addr 0x100001000)
119 CHECK:    DW_TAG_subprogram
120 CHECK:      DW_AT_name ("foo")
121 CHECK:      DW_AT_decl_file ("/Inputs{{[/\\]}}basic2.c")
122 CHECK:      DW_AT_type (0x000000a7
123 CHECK:      DW_AT_low_pc (0x0000000100000ed0)
124 CHECK:      DW_AT_high_pc (0x0000000100000f19)
125 CHECK:      DW_AT_frame_base (DW_OP_reg6 RBP)
126 CHECK:      DW_TAG_formal_parameter
127 CHECK:        DW_AT_name ("arg")
128 CHECK:        DW_AT_type (0x000000a7
129 CHECK:        DW_AT_location (DW_OP_fbreg -4)
130 CHECK:      NULL
131 CHECK:    DW_TAG_subprogram
132 CHECK:      DW_AT_name ("inc")
133 CHECK:      DW_AT_type (0x000000a7
134 CHECK:      DW_AT_low_pc (0x0000000100000f20)
135 CHECK:      DW_AT_high_pc (0x0000000100000f37)
136 CHECK:      DW_AT_frame_base (DW_OP_reg6 RBP)
137 CHECK:    NULL
139 CHECK:  Compile Unit:
141 CHECK:  DW_TAG_compile_unit
142 CHECK:    DW_AT_producer ("Apple LLVM version 6.0 (clang-600.0.39) (based on LLVM 3.5svn)")
143 CHECK:    DW_AT_name ("basic3.c")
144 CHECK:    DW_AT_stmt_list (0x00000093)
145 CHECK:    DW_AT_comp_dir ("/Inputs")
146 CHECK:    DW_AT_low_pc (0x0000000100000f40)
147 CHECK:    DW_TAG_variable
148 CHECK:      DW_AT_name ("val")
149 CHECK:      DW_AT_type (0x00000162
150 CHECK:      DW_AT_decl_file ("/Inputs{{[/\\]}}basic3.c")
151 BASIC:      DW_AT_location (DW_OP_addr 0x100001004)
152 ARCHIVE:    DW_AT_location (DW_OP_addr 0x100001008)
153 CHECK:    DW_TAG_volatile_type
154 CHECK:      DW_AT_type (0x00000167
155 CHECK:    DW_TAG_base_type
156 CHECK:      DW_AT_name ("int")
157 CHECK:    DW_TAG_subprogram
158 CHECK:      DW_AT_name ("bar")
159 CHECK:      DW_AT_type (0x00000167
160 CHECK:      DW_AT_low_pc (0x0000000100000f40)
161 CHECK:      DW_AT_high_pc (0x0000000100000f84)
162 CHECK:      DW_AT_frame_base (DW_OP_reg6 RBP)
163 CHECK:      DW_TAG_formal_parameter
164 CHECK:        DW_AT_name ("arg")
165 CHECK:        DW_AT_type (0x00000167
166 CHECK:        DW_AT_location (DW_OP_fbreg -8)
167 CHECK:      NULL
168 CHECK:    DW_TAG_subprogram
169 CHECK:      DW_AT_name ("inc")
170 CHECK:      DW_AT_type (0x00000167
171 CHECK:      DW_AT_low_pc (0x0000000100000f90)
172 CHECK:      DW_AT_high_pc (0x0000000100000fa9)
173 CHECK:      DW_AT_frame_base (DW_OP_reg6 RBP)
175 CHECK:    NULL
177 CHECK-NOT: .debug_loc contents
179 CHECK:.debug_aranges contents:
180 CHECK-NEXT:Address Range Header: length = 0x0000002c, format = DWARF32, version = 0x0002, cu_offset = 0x00000000, addr_size = 0x08, seg_size = 0x00
181 CHECK-NEXT:[0x0000000100000ea0, 0x0000000100000ec4)
182 CHECK-NEXT:Address Range Header: length = 0x0000003c, format = DWARF32, version = 0x0002, cu_offset = 0x00000081, addr_size = 0x08, seg_size = 0x00
183 CHECK-NEXT:[0x0000000100000ed0, 0x0000000100000f19)
184 CHECK-NEXT:[0x0000000100000f20, 0x0000000100000f37)
185 CHECK-NEXT:Address Range Header: length = 0x0000003c, format = DWARF32, version = 0x0002, cu_offset = 0x00000126, addr_size = 0x08, seg_size = 0x00
186 CHECK-NEXT:[0x0000000100000f40, 0x0000000100000f84)
187 CHECK-NEXT:[0x0000000100000f90, 0x0000000100000fa9)
189 CHECK: .debug_line contents:
190 CHECK: file_names[  1]:
191 CHECK-NEXT: name: "basic1.c"
192 CHECK-NEXT: dir_index: 0
193 CHECK: Address            Line   Column File   ISA Discriminator OpIndex Flags
194 CHECK-NEXT: ------------------ ------ ------ ------ --- ------------- ------- -------------
195 CHECK-NEXT: 0x0000000100000ea0     23      0      1   0             0       0  is_stmt
196 CHECK-NEXT: 0x0000000100000eb6     24      0      1   0             0       0  is_stmt prologue_end
197 CHECK-NEXT: 0x0000000100000ec4     24      0      1   0             0       0  is_stmt end_sequence
199 CHECK: file_names[  1]:
200 CHECK-NEXT: name: "basic2.c"
201 CHECK-NEXT: dir_index: 0
202 CHECK: Address            Line   Column File   ISA Discriminator OpIndex Flags
203 CHECK-NEXT: ------------------ ------ ------ ------ --- ------------- ------- -------------
204 CHECK-NEXT: 0x0000000100000ed0     19      0      1   0             0       0  is_stmt
205 CHECK-NEXT: 0x0000000100000ee2     20      0      1   0             0       0  is_stmt prologue_end
206 CHECK-NEXT: 0x0000000100000f19     20      0      1   0             0       0  is_stmt end_sequence
207 CHECK-NEXT: 0x0000000100000f20     14      0      1   0             0       0  is_stmt
208 CHECK-NEXT: 0x0000000100000f24     15      0      1   0             0       0  is_stmt prologue_end
209 CHECK-NEXT: 0x0000000100000f37     15      0      1   0             0       0  is_stmt end_sequence
211 CHECK: file_names[  1]:
212 CHECK-NEXT: name: "basic3.c"
213 CHECK-NEXT: dir_index: 0
214 CHECK: Address            Line   Column File   ISA Discriminator OpIndex Flags
215 CHECK-NEXT: ------------------ ------ ------ ------ --- ------------- ------- -------------
216 CHECK-NEXT: 0x0000000100000f40     16      0      1   0             0       0  is_stmt
217 CHECK-NEXT: 0x0000000100000f4b     17      0      1   0             0       0  is_stmt prologue_end
218 CHECK-NEXT: 0x0000000100000f58     18      0      1   0             0       0  is_stmt
219 CHECK-NEXT: 0x0000000100000f6c     19      0      1   0             0       0  is_stmt
220 CHECK-NEXT: 0x0000000100000f7b     20      0      1   0             0       0  is_stmt
221 CHECK-NEXT: 0x0000000100000f84     20      0      1   0             0       0  is_stmt end_sequence
222 CHECK-NEXT: 0x0000000100000f90     11      0      1   0             0       0  is_stmt
223 CHECK-NEXT: 0x0000000100000f9b     12      0      1   0             0       0  is_stmt prologue_end
224 CHECK-NEXT: 0x0000000100000fa9     12      0      1   0             0       0  is_stmt end_sequence
226 PUB: .debug_pubnames contents:
227 PUB-NEXT: length = 0x00000017, format = DWARF32, version = 0x0002, unit_offset = 0x00000000, unit_size = 0x00000081
228 PUB-NEXT: Offset     Name
229 PUB-NEXT: 0x00000026 "main"
230 PUB-NEXT: length = 0x00000036, format = DWARF32, version = 0x0002, unit_offset = 0x00000081, unit_size = 0x000000a5
231 PUB-NEXT: Offset     Name
232 PUB-NEXT: 0x0000002d "private_int"
233 PUB-NEXT: 0x00000042 "baz"
234 PUB-NEXT: 0x00000057 "foo"
235 PUB-NEXT: 0x00000086 "inc"
236 PUB-NEXT: length = 0x00000026, format = DWARF32, version = 0x0002, unit_offset = 0x00000126, unit_size = 0x00000096
237 PUB-NEXT: Offset     Name
238 PUB-NEXT: 0x00000026 "val"
239 PUB-NEXT: 0x00000048 "bar"
240 PUB-NEXT: 0x00000077 "inc"
242 PUB: .debug_pubtypes contents:
243 PUB-NEXT: length = 0x0000001f, format = DWARF32, version = 0x0002, unit_offset = 0x00000000, unit_size = 0x00000081
244 PUB-NEXT: Offset     Name
245 PUB-NEXT: 0x00000063 "int"
246 PUB-NEXT: 0x00000079 "char"
247 PUB-NEXT: length = 0x00000016, format = DWARF32, version = 0x0002, unit_offset = 0x00000081, unit_size = 0x000000a5
248 PUB-NEXT: Offset     Name
249 PUB-NEXT: 0x00000026 "int"
250 PUB-NEXT: length = 0x00000016, format = DWARF32, version = 0x0002, unit_offset = 0x00000126, unit_size = 0x00000096
251 PUB-NEXT: Offset     Name
252 PUB-NEXT: 0x00000041 "int"