llvm.org GIT mirror llvm / 8e66c2e
llvm-dwarfdump: Replace -debug-dump=sect option with individual options. As discussed on llvm-dev in http://lists.llvm.org/pipermail/llvm-dev/2017-September/117301.html this changes the command line interface of llvm-dwarfdump to match the one used by the dwarfdump utility shipping on macOS. In addition to being shorter to type this format also has the advantage of allowing more than one section to be specified at the same time. In a nutshell, with this change $ llvm-dwarfdump --debug-dump=info $ llvm-dwarfdump --debug-dump=apple-objc becomes $ dwarfdump --debug-info --apple-objc Differential Revision: https://reviews.llvm.org/D37714 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312970 91177308-0d34-0410-b5e6-96231b3b80d8 Adrian Prantl 2 years ago
229 changed file(s) with 383 addition(s) and 367 deletion(s). Raw diff Collapse all Expand all
1919 defined HANDLE_DW_LNE || defined HANDLE_DW_LNCT || \
2020 defined HANDLE_DW_MACRO || defined HANDLE_DW_RLE || \
2121 defined HANDLE_DW_CFA || defined HANDLE_DW_APPLE_PROPERTY || \
22 defined HANDLE_DW_UT)
22 defined HANDLE_DW_UT || defined HANDLE_DWARF_SECTION)
2323 #error "Missing macro definition of HANDLE_DW*"
2424 #endif
2525
8989
9090 #ifndef HANDLE_DW_UT
9191 #define HANDLE_DW_UT(ID, NAME)
92 #endif
93
94 #ifndef HANDLE_DWARF_SECTION
95 #define HANDLE_DWARF_SECTION(ENUM_NAME, ELF_NAME, CMDLINE_NAME)
9296 #endif
9397
9498 HANDLE_DW_TAG(0x0000, null, 2, DWARF)
818822 HANDLE_DW_UT(0x05, split_compile)
819823 HANDLE_DW_UT(0x06, split_type)
820824
825 // DWARF section types. (enum name, ELF name, cmdline name)
826 // Note that these IDs don't mean anything.
827 // TODO: Add Mach-O and COFF names.
828 // Official DWARF sections.
829 HANDLE_DWARF_SECTION(DebugAbbrev, ".debug_abbrev", "debug-abbrev")
830 HANDLE_DWARF_SECTION(DebugAbbrevDwo, ".debug_abbrev.dwo", "debug-abbrev-dwo")
831 HANDLE_DWARF_SECTION(DebugAranges, ".debug_aranges", "debug-aranges")
832 HANDLE_DWARF_SECTION(DebugInfo, ".debug_info", "debug-info")
833 HANDLE_DWARF_SECTION(DebugInfoDwo, ".debug_info.dwo", "debug-info-dwo")
834 HANDLE_DWARF_SECTION(DebugTypes, ".debug_types", "debug-types")
835 HANDLE_DWARF_SECTION(DebugTypesDwo, ".debug_types.dwo", "debug-types-dwo")
836 HANDLE_DWARF_SECTION(DebugLine, ".debug_line", "debug-line")
837 HANDLE_DWARF_SECTION(DebugLineDwo, ".debug_line.dwo", "debug-line-dwo")
838 HANDLE_DWARF_SECTION(DebugLoc, ".debug_loc", "debug-loc")
839 HANDLE_DWARF_SECTION(DebugLocDwo, ".debug_loc.dwo", "debug-loc-dwo")
840 HANDLE_DWARF_SECTION(DebugFrames, ".debug_frames", "debug-frames")
841 HANDLE_DWARF_SECTION(DebugMacro, ".debug_macro", "debug-macro")
842 HANDLE_DWARF_SECTION(DebugRanges, ".debug_ranges", "debug-ranges")
843 HANDLE_DWARF_SECTION(DebugPubnames, ".debug_pubnames", "debug-pubnames")
844 HANDLE_DWARF_SECTION(DebugPubtypes, ".debug_pubtypes", "debug-pubtypes")
845 HANDLE_DWARF_SECTION(DebugGnuPubnames, ".debug_gnu_pubnames", "debug-gnu-pubnames")
846 HANDLE_DWARF_SECTION(DebugGnuPubtypes, ".debug_gnu_pubtypes", "debug-gnu-pubtypes")
847 HANDLE_DWARF_SECTION(DebugStr, ".debug_str", "debug-str")
848 HANDLE_DWARF_SECTION(DebugStrOffsets, ".debug_str_offsets", "debug-str-offsets")
849 HANDLE_DWARF_SECTION(DebugStrDwo, ".debug_str.dwo", "debug-str-dwo")
850 HANDLE_DWARF_SECTION(DebugStrOffsetsDwo, ".debug_str_offsets.dwo", "debug-str-offsets-dwo")
851 HANDLE_DWARF_SECTION(DebugCUIndex, ".debug_cu_index", "debug-cu-index")
852 HANDLE_DWARF_SECTION(DebugTUIndex, ".debug_tu_index", "debug-tu-index")
853 // Vendor extensions.
854 HANDLE_DWARF_SECTION(AppleNames, ".apple_names", "apple-names")
855 HANDLE_DWARF_SECTION(AppleTypes, ".apple_types", "apple-types")
856 HANDLE_DWARF_SECTION(AppleNamespaces, ".apple_namespaces", "apple-namespaces")
857 HANDLE_DWARF_SECTION(AppleObjC, ".apple_objc", "apple-objc")
858 HANDLE_DWARF_SECTION(GdbIndex, ".gdb_index", "gdb-index")
859
860
821861 #undef HANDLE_DW_TAG
822862 #undef HANDLE_DW_AT
823863 #undef HANDLE_DW_FORM
835875 #undef HANDLE_DW_CFA
836876 #undef HANDLE_DW_APPLE_PROPERTY
837877 #undef HANDLE_DW_UT
878 #undef HANDLE_DWARF_SECTION
111111 : FLIKind(FLIKind), FNKind(FNKind) {}
112112 };
113113
114 namespace {
115 /// This is just a helper to programmatically construct DIDumpType.
116 enum DIDumpTypeCounter {
117 DIDT_ID_Null = 0,
118 #define HANDLE_DWARF_SECTION(ENUM_NAME, ELF_NAME, CMDLINE_NAME) \
119 DIDT_ID##ENUM_NAME,
120 #include "llvm/BinaryFormat/Dwarf.def"
121 #undef HANDLE_DWARF_SECTION
122 };
123 }
124
114125 /// Selects which debug sections get dumped.
115 enum DIDumpType {
126 enum DIDumpType : uint64_t {
116127 DIDT_Null,
117 DIDT_All,
118 DIDT_Abbrev,
119 DIDT_AbbrevDwo,
120 DIDT_Aranges,
121 DIDT_Frames,
122 DIDT_Info,
123 DIDT_InfoDwo,
124 DIDT_Types,
125 DIDT_TypesDwo,
126 DIDT_Line,
127 DIDT_LineDwo,
128 DIDT_Loc,
129 DIDT_LocDwo,
130 DIDT_Macro,
131 DIDT_Ranges,
132 DIDT_Pubnames,
133 DIDT_Pubtypes,
134 DIDT_GnuPubnames,
135 DIDT_GnuPubtypes,
136 DIDT_Str,
137 DIDT_StrOffsets,
138 DIDT_StrDwo,
139 DIDT_StrOffsetsDwo,
140 DIDT_AppleNames,
141 DIDT_AppleTypes,
142 DIDT_AppleNamespaces,
143 DIDT_AppleObjC,
144 DIDT_CUIndex,
145 DIDT_GdbIndex,
146 DIDT_TUIndex,
128 DIDT_All = ~0ULL,
129 #define HANDLE_DWARF_SECTION(ENUM_NAME, ELF_NAME, CMDLINE_NAME) \
130 DIDT_##ENUM_NAME = 1 << DIDT_ID##ENUM_NAME,
131 #include "llvm/BinaryFormat/Dwarf.def"
132 #undef HANDLE_DWARF_SECTION
147133 };
148134
149135 /// Container for dump options that control which debug information will be
150136 /// dumped.
151137 struct DIDumpOptions {
152 DIDumpType DumpType = DIDT_All;
138 uint64_t DumpType = DIDT_All;
153139 bool DumpEH = false;
154140 bool SummarizeTypes = false;
155141 bool Brief = false;
169155
170156 virtual void dump(raw_ostream &OS, DIDumpOptions DumpOpts) = 0;
171157
172 virtual bool verify(raw_ostream &OS, DIDumpType DumpType = DIDT_All) {
158 virtual bool verify(raw_ostream &OS, uint64_t DumpType = DIDT_All) {
173159 // No verifier? Just say things went well.
174160 return true;
175161 }
122122
123123 void dump(raw_ostream &OS, DIDumpOptions DumpOpts) override;
124124
125 bool verify(raw_ostream &OS, DIDumpType DumpType = DIDT_All) override;
125 bool verify(raw_ostream &OS, uint64_t DumpType = DIDT_All) override;
126126
127127 using cu_iterator_range = DWARFUnitSection::iterator_range;
128128 using tu_iterator_range = DWARFUnitSection::iterator_range;
199199 }
200200
201201 void DWARFContext::dump(raw_ostream &OS, DIDumpOptions DumpOpts) {
202 DIDumpType DumpType = DumpOpts.DumpType;
202 uint64_t DumpType = DumpOpts.DumpType;
203203 bool DumpEH = DumpOpts.DumpEH;
204204 bool SummarizeTypes = DumpOpts.SummarizeTypes;
205205
206 if (DumpType == DIDT_All || DumpType == DIDT_Abbrev) {
206 if (DumpType & DIDT_DebugAbbrev) {
207207 OS << ".debug_abbrev contents:\n";
208208 getDebugAbbrev()->dump(OS);
209209 }
210210
211 if (DumpType == DIDT_All || DumpType == DIDT_AbbrevDwo)
211 if (DumpType & DIDT_DebugAbbrevDwo)
212212 if (const DWARFDebugAbbrev *D = getDebugAbbrevDWO()) {
213213 OS << "\n.debug_abbrev.dwo contents:\n";
214214 D->dump(OS);
215215 }
216216
217 if (DumpType == DIDT_All || DumpType == DIDT_Info) {
217 if (DumpType & DIDT_DebugInfo) {
218218 OS << "\n.debug_info contents:\n";
219219 for (const auto &CU : compile_units())
220220 CU->dump(OS, DumpOpts);
221221 }
222222
223 if ((DumpType == DIDT_All || DumpType == DIDT_InfoDwo) &&
223 if ((DumpType & DIDT_DebugInfoDwo) &&
224224 getNumDWOCompileUnits()) {
225225 OS << "\n.debug_info.dwo contents:\n";
226226 for (const auto &DWOCU : dwo_compile_units())
227227 DWOCU->dump(OS, DumpOpts);
228228 }
229229
230 if ((DumpType == DIDT_All || DumpType == DIDT_Types) && getNumTypeUnits()) {
230 if ((DumpType & DIDT_DebugTypes) && getNumTypeUnits()) {
231231 OS << "\n.debug_types contents:\n";
232232 for (const auto &TUS : type_unit_sections())
233233 for (const auto &TU : TUS)
234234 TU->dump(OS, SummarizeTypes);
235235 }
236236
237 if ((DumpType == DIDT_All || DumpType == DIDT_TypesDwo) &&
237 if ((DumpType & DIDT_DebugTypesDwo) &&
238238 getNumDWOTypeUnits()) {
239239 OS << "\n.debug_types.dwo contents:\n";
240240 for (const auto &DWOTUS : dwo_type_unit_sections())
242242 DWOTU->dump(OS, SummarizeTypes);
243243 }
244244
245 if (DumpType == DIDT_All || DumpType == DIDT_Loc) {
245 if (DumpType & DIDT_DebugLoc) {
246246 OS << "\n.debug_loc contents:\n";
247247 getDebugLoc()->dump(OS, getRegisterInfo());
248248 }
249249
250 if (DumpType == DIDT_All || DumpType == DIDT_LocDwo) {
250 if (DumpType & DIDT_DebugLocDwo) {
251251 OS << "\n.debug_loc.dwo contents:\n";
252252 getDebugLocDWO()->dump(OS, getRegisterInfo());
253253 }
254254
255 if (DumpType == DIDT_All || DumpType == DIDT_Frames) {
255 if (DumpType & DIDT_DebugFrames) {
256256 OS << "\n.debug_frame contents:\n";
257257 getDebugFrame()->dump(OS);
258258 if (DumpEH) {
261261 }
262262 }
263263
264 if (DumpType == DIDT_All || DumpType == DIDT_Macro) {
264 if (DumpType & DIDT_DebugMacro) {
265265 OS << "\n.debug_macinfo contents:\n";
266266 getDebugMacro()->dump(OS);
267267 }
268268
269269 uint32_t offset = 0;
270 if (DumpType == DIDT_All || DumpType == DIDT_Aranges) {
270 if (DumpType & DIDT_DebugAranges) {
271271 OS << "\n.debug_aranges contents:\n";
272272 DataExtractor arangesData(DObj->getARangeSection(), isLittleEndian(), 0);
273273 DWARFDebugArangeSet set;
276276 }
277277
278278 uint8_t savedAddressByteSize = 0;
279 if (DumpType == DIDT_All || DumpType == DIDT_Line) {
279 if (DumpType & DIDT_DebugLine) {
280280 OS << "\n.debug_line contents:\n";
281281 for (const auto &CU : compile_units()) {
282282 savedAddressByteSize = CU->getAddressByteSize();
294294 }
295295 }
296296
297 if (DumpType == DIDT_All || DumpType == DIDT_CUIndex) {
297 if (DumpType & DIDT_DebugCUIndex) {
298298 OS << "\n.debug_cu_index contents:\n";
299299 getCUIndex().dump(OS);
300300 }
301301
302 if (DumpType == DIDT_All || DumpType == DIDT_TUIndex) {
302 if (DumpType & DIDT_DebugTUIndex) {
303303 OS << "\n.debug_tu_index contents:\n";
304304 getTUIndex().dump(OS);
305305 }
306306
307 if (DumpType == DIDT_All || DumpType == DIDT_LineDwo) {
307 if (DumpType & DIDT_DebugLineDwo) {
308308 OS << "\n.debug_line.dwo contents:\n";
309309 unsigned stmtOffset = 0;
310310 DWARFDataExtractor lineData(*DObj, DObj->getLineDWOSection(),
316316 }
317317 }
318318
319 if (DumpType == DIDT_All || DumpType == DIDT_Str) {
319 if (DumpType & DIDT_DebugStr) {
320320 OS << "\n.debug_str contents:\n";
321321 DataExtractor strData(DObj->getStringSection(), isLittleEndian(), 0);
322322 offset = 0;
327327 }
328328 }
329329
330 if ((DumpType == DIDT_All || DumpType == DIDT_StrDwo) &&
330 if ((DumpType & DIDT_DebugStrDwo) &&
331331 !DObj->getStringDWOSection().empty()) {
332332 OS << "\n.debug_str.dwo contents:\n";
333333 DataExtractor strDWOData(DObj->getStringDWOSection(), isLittleEndian(), 0);
339339 }
340340 }
341341
342 if (DumpType == DIDT_All || DumpType == DIDT_Ranges) {
342 if (DumpType & DIDT_DebugRanges) {
343343 OS << "\n.debug_ranges contents:\n";
344344 // In fact, different compile units may have different address byte
345345 // sizes, but for simplicity we just use the address byte size of the last
353353 rangeList.dump(OS);
354354 }
355355
356 if (DumpType == DIDT_All || DumpType == DIDT_Pubnames)
356 if (DumpType & DIDT_DebugPubnames)
357357 DWARFDebugPubTable(DObj->getPubNamesSection(), isLittleEndian(), false)
358358 .dump("debug_pubnames", OS);
359359
360 if (DumpType == DIDT_All || DumpType == DIDT_Pubtypes)
360 if (DumpType & DIDT_DebugPubtypes)
361361 DWARFDebugPubTable(DObj->getPubTypesSection(), isLittleEndian(), false)
362362 .dump("debug_pubtypes", OS);
363363
364 if (DumpType == DIDT_All || DumpType == DIDT_GnuPubnames)
364 if (DumpType & DIDT_DebugGnuPubnames)
365365 DWARFDebugPubTable(DObj->getGnuPubNamesSection(), isLittleEndian(),
366366 true /* GnuStyle */)
367367 .dump("debug_gnu_pubnames", OS);
368368
369 if (DumpType == DIDT_All || DumpType == DIDT_GnuPubtypes)
369 if (DumpType & DIDT_DebugGnuPubtypes)
370370 DWARFDebugPubTable(DObj->getGnuPubTypesSection(), isLittleEndian(),
371371 true /* GnuStyle */)
372372 .dump("debug_gnu_pubtypes", OS);
373373
374 if (DumpType == DIDT_All || DumpType == DIDT_StrOffsets)
374 if (DumpType & DIDT_DebugStrOffsets)
375375 dumpStringOffsetsSection(
376376 OS, "debug_str_offsets", *DObj, DObj->getStringOffsetSection(),
377377 DObj->getStringSection(), isLittleEndian(), getMaxVersion());
378378
379 if (DumpType == DIDT_All || DumpType == DIDT_StrOffsetsDwo) {
379 if (DumpType & DIDT_DebugStrOffsetsDwo) {
380380 dumpStringOffsetsSection(
381381 OS, "debug_str_offsets.dwo", *DObj, DObj->getStringOffsetDWOSection(),
382382 DObj->getStringDWOSection(), isLittleEndian(), getMaxVersion());
383383 }
384384
385 if ((DumpType == DIDT_All || DumpType == DIDT_GdbIndex) &&
385 if ((DumpType & DIDT_GdbIndex) &&
386386 !DObj->getGdbIndexSection().empty()) {
387387 OS << "\n.gnu_index contents:\n";
388388 getGdbIndex().dump(OS);
389389 }
390390
391 if (DumpType == DIDT_All || DumpType == DIDT_AppleNames)
391 if (DumpType & DIDT_AppleNames)
392392 dumpAccelSection(OS, "apple_names", *DObj, DObj->getAppleNamesSection(),
393393 DObj->getStringSection(), isLittleEndian());
394394
395 if (DumpType == DIDT_All || DumpType == DIDT_AppleTypes)
395 if (DumpType & DIDT_AppleTypes)
396396 dumpAccelSection(OS, "apple_types", *DObj, DObj->getAppleTypesSection(),
397397 DObj->getStringSection(), isLittleEndian());
398398
399 if (DumpType == DIDT_All || DumpType == DIDT_AppleNamespaces)
399 if (DumpType & DIDT_AppleNamespaces)
400400 dumpAccelSection(OS, "apple_namespaces", *DObj,
401401 DObj->getAppleNamespacesSection(),
402402 DObj->getStringSection(), isLittleEndian());
403403
404 if (DumpType == DIDT_All || DumpType == DIDT_AppleObjC)
404 if (DumpType & DIDT_AppleObjC)
405405 dumpAccelSection(OS, "apple_objc", *DObj, DObj->getAppleObjCSection(),
406406 DObj->getStringSection(), isLittleEndian());
407407 }
433433 return DWARFDie();
434434 }
435435
436 bool DWARFContext::verify(raw_ostream &OS, DIDumpType DumpType) {
436 bool DWARFContext::verify(raw_ostream &OS, uint64_t DumpType) {
437437 bool Success = true;
438438 DWARFVerifier verifier(OS, *this);
439439
440440 Success &= verifier.handleDebugAbbrev();
441 if (DumpType == DIDT_All || DumpType == DIDT_Info)
441 if (DumpType & DIDT_DebugInfo)
442442 Success &= verifier.handleDebugInfo();
443 if (DumpType == DIDT_All || DumpType == DIDT_Line)
443 if (DumpType & DIDT_DebugLine)
444444 Success &= verifier.handleDebugLine();
445445 Success &= verifier.handleAccelTables();
446446 return Success;
None ; RUN: llc -arm-global-merge -global-merge-group-by-use=false -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
0 ; RUN: llc -arm-global-merge -global-merge-group-by-use=false -filetype=obj < %s | llvm-dwarfdump -debug-info - | FileCheck %s
11
22 source_filename = "test/CodeGen/ARM/2011-01-19-MergedGlobalDbg.ll"
33 target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:32:64-v128:32:128-a0:0:32-n32"
None ; RUN: llc -arm-global-merge -global-merge-group-by-use=false -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
0 ; RUN: llc -arm-global-merge -global-merge-group-by-use=false -filetype=obj < %s | llvm-dwarfdump -debug-info - | FileCheck %s
11
22 ; CHECK: DW_TAG_variable
33 ; CHECK-NOT: DW_TAG
None ; RUN: llc < %s - -filetype=obj | llvm-dwarfdump -debug-dump=loc - | FileCheck %s
0 ; RUN: llc < %s - -filetype=obj | llvm-dwarfdump -debug-loc - | FileCheck %s
11 ; Radar 9376013
22 target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:32:64-v128:32:128-a0:0:32-n32"
33 target triple = "thumbv7-apple-macosx10.6.7"
0 ; RUN: llc -O2 -march=bpfel %s -o %t -filetype=obj
1 ; RUN: llvm-dwarfdump -debug-dump=line %t | FileCheck %s
1 ; RUN: llvm-dwarfdump -debug-line %t | FileCheck %s
22 ; RUN: llc -O2 -march=bpfeb %s -o %t -filetype=obj
3 ; RUN: llvm-dwarfdump -debug-dump=line %t | FileCheck %s
3 ; RUN: llvm-dwarfdump -debug-line %t | FileCheck %s
44
55 source_filename = "testprog.c"
66 target datalayout = "e-m:e-p:64:64-i64:64-n32:64-S128"
None ; RUN: llc < %s -filetype=obj | llvm-dwarfdump -debug-dump=info - | FileCheck %s
1 ; RUN: llc < %s -filetype=obj -regalloc=basic | llvm-dwarfdump -debug-dump=info - | FileCheck %s
0 ; RUN: llc < %s -filetype=obj | llvm-dwarfdump -debug-info - | FileCheck %s
1 ; RUN: llc < %s -filetype=obj -regalloc=basic | llvm-dwarfdump -debug-info - | FileCheck %s
22 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
33 target triple = "x86_64-apple-darwin10.0.0"
44
0 ; RUN: llc -filetype=obj -use-unknown-locations=Enable -mtriple=x86_64-unknown-linux %s -o %t
1 ; RUN: llvm-dwarfdump -debug-dump=line %t | FileCheck %s
1 ; RUN: llvm-dwarfdump -debug-line %t | FileCheck %s
22
33 define void @_Z3bazv() !dbg !6 {
44 call void @_Z3foov(), !dbg !9
0 ; RUN: llc %s -o %t -filetype=obj
1 ; RUN: llvm-dwarfdump -debug-dump=line %t | FileCheck %s
1 ; RUN: llvm-dwarfdump -debug-line %t | FileCheck %s
22
33 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
44 target triple = "x86_64-unknown-linux-gnu"
0 ; RUN: llc -mtriple aarch64_be-gnu-linux -O0 -filetype=obj -o %t_be.o %s
1 ; RUN: llvm-dwarfdump -debug-dump=info %t_be.o | FileCheck %s
1 ; RUN: llvm-dwarfdump -debug-info %t_be.o | FileCheck %s
22
33 ; Produced at -O0 from:
44 ; struct bitfield {
None ; RUN: llc -O0 -mtriple=amdgcn--amdhsa -mcpu=fiji -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
0 ; RUN: llc -O0 -mtriple=amdgcn--amdhsa -mcpu=fiji -filetype=obj < %s | llvm-dwarfdump -debug-info - | FileCheck %s
11
22 ; LLVM IR generated with the following command and OpenCL source:
33 ;
None ; RUN: llc -O0 -mtriple=amdgcn--amdhsa -mcpu=fiji -verify-machineinstrs -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
0 ; RUN: llc -O0 -mtriple=amdgcn--amdhsa -mcpu=fiji -verify-machineinstrs -filetype=obj < %s | llvm-dwarfdump -debug-info - | FileCheck %s
11
22 ; LLVM IR generated with the following command and OpenCL source:
33 ;
None ; RUN: llc -O0 -mtriple=amdgcn-amd-amdhsa -mcpu=fiji -verify-machineinstrs -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
0 ; RUN: llc -O0 -mtriple=amdgcn-amd-amdhsa -mcpu=fiji -verify-machineinstrs -filetype=obj < %s | llvm-dwarfdump -debug-info - | FileCheck %s
11
22 ; LLVM IR generated with the following command and OpenCL source:
33 ;
0 ; RUN: llc -filetype=asm < %s | FileCheck %s
11 ; RUN: llc -filetype=obj < %s \
2 ; RUN: | llvm-dwarfdump -debug-dump=info - | FileCheck %s --check-prefix=DWARF
2 ; RUN: | llvm-dwarfdump -debug-info - | FileCheck %s --check-prefix=DWARF
33 ;
44 ; CHECK: @DEBUG_VALUE: h:x <- [DW_OP_plus_uconst {{.*}}] [%R{{.*}}+0]
55 ; DWARF: DW_TAG_formal_parameter
None ; RUN: llc -filetype=obj -o - < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
0 ; RUN: llc -filetype=obj -o - < %s | llvm-dwarfdump -debug-info - | FileCheck %s
11 ;
22 ; Checks that we're creating two ranges, one that terminates immediately
33 ; and one that spans the rest of the function. This isn't necessarily the
0 ; RUN: llc -O0 -filetype=obj -mtriple=armeb-none-freebsd -debugger-tune=lldb %s -o - \
1 ; RUN: | llvm-dwarfdump --debug-dump=info - | FileCheck %s
1 ; RUN: | llvm-dwarfdump --debug-info - | FileCheck %s
22 ; Generated from:
33 ; struct S {
44 ; int j:5;
0 ; RUN: %llc_dwarf -O0 -filetype=obj -o %t.o %s
1 ; RUN: llvm-dwarfdump -debug-dump=info %t.o | FileCheck %s
1 ; RUN: llvm-dwarfdump -debug-info %t.o | FileCheck %s
22 ; REQUIRES: object-emission
33 ;
44 ; Generated from:
None ; RUN: %llc_dwarf -filetype=obj -mattr=+vfp2 -float-abi=hard < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
1 ; RUN: %llc_dwarf -filetype=obj -mattr=-vfp2 -float-abi=soft < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
0 ; RUN: %llc_dwarf -filetype=obj -mattr=+vfp2 -float-abi=hard < %s | llvm-dwarfdump -debug-info - | FileCheck %s
1 ; RUN: %llc_dwarf -filetype=obj -mattr=-vfp2 -float-abi=soft < %s | llvm-dwarfdump -debug-info - | FileCheck %s
22 ; REQUIRES: object-emission
33
44 ; Generated by clang -O1 -g from the following C source:
None ; RUN: llc < %s - -filetype=obj | llvm-dwarfdump -debug-dump=loc - | FileCheck %s
0 ; RUN: llc < %s - -filetype=obj | llvm-dwarfdump -debug-loc - | FileCheck %s
11 target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:32:64-v128:32:128-a0:0:32-n32"
22 target triple = "thumbv7-apple-macosx10.6.7"
33
0 ; RUN: %llc_dwarf -O0 -filetype=obj -o %t.o %s
1 ; RUN: llvm-dwarfdump -debug-dump=info %t.o | FileCheck %s
1 ; RUN: llvm-dwarfdump -debug-info %t.o | FileCheck %s
22 ; REQUIRES: object-emission
33 target datalayout = "e-m:o-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
44 target triple = "thumbv7-apple-unknown-macho"
0 ; REQUIRES: object-emission
11
2 ; RUN: %llc_dwarf -O0 -filetype=obj -o - < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
2 ; RUN: %llc_dwarf -O0 -filetype=obj -o - < %s | llvm-dwarfdump -debug-info - | FileCheck %s
33 ; Radar 7833483
44 ; Do not emit a separate out-of-line definition DIE for the function-local 'foo'
55 ; function (member of the function local 'A' type)
0 ; REQUIRES: object-emission
11
2 ; RUN: %llc_dwarf -O0 -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
2 ; RUN: %llc_dwarf -O0 -filetype=obj < %s | llvm-dwarfdump -debug-info - | FileCheck %s
33
44 ; Check that two compile units are generated
55
22 ; For some reason, the output when targetting sparc is not quite as expected.
33 ; XFAIL: sparc
44
5 ; RUN: %llc_dwarf -O0 -filetype=obj -dwarf-linkage-names=All < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
5 ; RUN: %llc_dwarf -O0 -filetype=obj -dwarf-linkage-names=All < %s | llvm-dwarfdump -debug-info - | FileCheck %s
66
77 ; IR generated from clang -O0 with:
88 ; struct C {
0 ; REQUIRES: object-emission
1 ; RUN: %llc_dwarf -dwarf-accel-tables=Enable -filetype=obj -o - < %s | llvm-dwarfdump -debug-dump=apple_names - | FileCheck %s
1 ; RUN: %llc_dwarf -dwarf-accel-tables=Enable -filetype=obj -o - < %s \
2 ; RUN: | llvm-dwarfdump -apple-names - | FileCheck %s
23
34 ; Generated from the following C code using
45 ; clang -S -emit-llvm hash-collision.c
0 ; REQUIRES: object-emission
11
2 ; RUN: %llc_dwarf -O0 -filetype=obj %s -o - | llvm-dwarfdump -debug-dump=info - | FileCheck %s
2 ; RUN: %llc_dwarf -O0 -filetype=obj %s -o - | llvm-dwarfdump -debug-info - | FileCheck %s
33
44 ; Ensure that pointer constants are emitted as unsigned data. Alternatively,
55 ; these could be signless data (dataN).
0 ; REQUIRES: object-emission
11
2 ; RUN: %llc_dwarf -O0 -filetype=obj -dwarf-linkage-names=All < %s | llvm-dwarfdump -debug-dump=info - | FileCheck -implicit-check-not=DW_TAG %s
2 ; RUN: %llc_dwarf -O0 -filetype=obj -dwarf-linkage-names=All < %s | llvm-dwarfdump -debug-info - | FileCheck -implicit-check-not=DW_TAG %s
33 ; RUN: %llc_dwarf -dwarf-accel-tables=Enable -dwarf-linkage-names=All -O0 -filetype=obj < %s | llvm-dwarfdump - | FileCheck --check-prefix=CHECK-ACCEL --check-prefix=CHECK %s
44
55 ; Build from source:
0 ; REQUIRES: object-emission
11
2 ; RUN: %llc_dwarf -O0 -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
2 ; RUN: %llc_dwarf -O0 -filetype=obj < %s | llvm-dwarfdump -debug-info - | FileCheck %s
33
44 ; Testing that two distinct (distinct by writing them in separate files, while
55 ; still fulfilling C++'s ODR by having identical token sequences) functions,
0 ; REQUIRES: object-emission
11
2 ; RUN: %llc_dwarf -O0 -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
2 ; RUN: %llc_dwarf -O0 -filetype=obj < %s | llvm-dwarfdump -debug-info - | FileCheck %s
33
44 ; Built from source:
55 ; $ clang++ a.cpp b.cpp -g -c -emit-llvm
0 ; REQUIRES: object-emission
11
2 ; RUN: %llc_dwarf -O0 -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
2 ; RUN: %llc_dwarf -O0 -filetype=obj < %s | llvm-dwarfdump -debug-info - | FileCheck %s
33
44 ; Built from the following source with clang -O1
55 ; struct S { int i; };
0 ; REQUIRES: object-emission
11
2 ; RUN: %llc_dwarf < %s -filetype=obj | llvm-dwarfdump -debug-dump=info - | FileCheck %s
2 ; RUN: %llc_dwarf < %s -filetype=obj | llvm-dwarfdump -debug-info - | FileCheck %s
33
44 ; Given the following source, ensure that the decl_line/file is correctly
55 ; emitted and omitted on definitions if it mismatches/matches the declaration
0 ; REQUIRES: object-emission
11
2 ; RUN: %llc_dwarf < %s -filetype=obj | llvm-dwarfdump -debug-dump=info - | FileCheck %s
2 ; RUN: %llc_dwarf < %s -filetype=obj | llvm-dwarfdump -debug-info - | FileCheck %s
33
44 ; Given the following source, ensure that the discriminator is emitted for
55 ; the inlined callsite.
0 ; REQUIRES: object-emission
11
22 ; RUN: %llc_dwarf -generate-dwarf-pub-sections=Enable -filetype=obj -o %t.o < %s
3 ; RUN: llvm-dwarfdump -debug-dump=pubnames %t.o | FileCheck %s
3 ; RUN: llvm-dwarfdump -debug-pubnames %t.o | FileCheck %s
44 ; ModuleID = 'dwarf-public-names.cpp'
55 ;
66 ; Generated from:
0 ; REQUIRES: object-emission
11 ;
2 ; RUN: %llc_dwarf -filetype=obj -O0 -dwarf-linkage-names=All < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
2 ; RUN: %llc_dwarf -filetype=obj -O0 -dwarf-linkage-names=All < %s | llvm-dwarfdump -debug-info - | FileCheck %s
33
44 ; Make sure we can handle enums with the same identifier but in enum types of
55 ; different compile units.
0 ; REQUIRES: object-emission
11
2 ; RUN: %llc_dwarf -O0 -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck --implicit-check-not "{{DW_TAG|NULL}}" %s
2 ; RUN: %llc_dwarf -O0 -filetype=obj < %s | llvm-dwarfdump -debug-info - | FileCheck --implicit-check-not "{{DW_TAG|NULL}}" %s
33
44 ; Generated from the following source:
55 ; namespace ns {
0 ; REQUIRES: object-emission
11
2 ; RUN: %llc_dwarf -O2 -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
2 ; RUN: %llc_dwarf -O2 -filetype=obj < %s | llvm-dwarfdump -debug-info - | FileCheck %s
33
44 ; This is a test case that's as reduced as I can get it, though I haven't fully
55 ; understood the mechanisms by which this bug occurs, so perhaps there's further
0 ; REQUIRES: object-emission
11
2 ; RUN: %llc_dwarf -O0 -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
2 ; RUN: %llc_dwarf -O0 -filetype=obj < %s | llvm-dwarfdump -debug-info - | FileCheck %s
33
44 ; bool f();
55 ; inline __attribute__((always_inline)) int f1() {
None ; RUN: %llc_dwarf -O0 -filetype=obj -dwarf-linkage-names=Abstract < %s | llvm-dwarfdump -debug-dump=info - > %t
0 ; RUN: %llc_dwarf -O0 -filetype=obj -dwarf-linkage-names=Abstract < %s | llvm-dwarfdump -debug-info - > %t
11 ; RUN: FileCheck %s -check-prefix=ONENAME < %t
22 ; RUN: FileCheck %s -check-prefix=REF < %t
33 ; Verify tuning for SCE gets us Abstract only.
4 ; RUN: %llc_dwarf -O0 -filetype=obj -debugger-tune=sce < %s | llvm-dwarfdump -debug-dump=info - > %t
4 ; RUN: %llc_dwarf -O0 -filetype=obj -debugger-tune=sce < %s | llvm-dwarfdump -debug-info - > %t
55 ; RUN: FileCheck %s -check-prefix=ONENAME < %t
66 ; RUN: FileCheck %s -check-prefix=REF < %t
77 ; REQUIRES: object-emission
0 ; REQUIRES: object-emission
11
2 ; RUN: %llc_dwarf < %s -filetype=obj | llvm-dwarfdump -debug-dump=line - | FileCheck %s
2 ; RUN: %llc_dwarf < %s -filetype=obj | llvm-dwarfdump -debug-line - | FileCheck %s
33 ; RUN: %llc_dwarf < %s -filetype=asm | FileCheck --check-prefix=ASM %s
44
55 ; If multiple line tables are emitted, one per CU, those line tables can
0 ; REQUIRES: object-emission
11
22 ; RUN: %llc_dwarf -O0 -filetype=obj < %s > %t
3 ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
3 ; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s
44
55 ; Make sure we're emitting DW_AT_main_subprogram.
66 ; CHECK: DW_TAG_subprogram
0 ; REQUIRES: object-emission
11
2 ; RUN: %llc_dwarf -filetype=obj -O0 < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
2 ; RUN: %llc_dwarf -filetype=obj -O0 < %s | llvm-dwarfdump -debug-info - | FileCheck %s
33
44 ; generated by clang from:
55 ; struct foo {
11 ; XFAIL: hexagon
22
33 ; RUN: %llc_dwarf -filetype=obj -O0 < %s > %t
4 ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
4 ; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s
55 ; CHECK: DW_TAG_ptr_to_member_type
66 ; CHECK: DW_TAG_ptr_to_member_type
77 ; CHECK-NEXT: DW_AT_type [DW_FORM_ref4] (cu + {{.*}} => {[[TYPE:0x[0-9a-f]+]]})
0 ; REQUIRES: object-emission
11
2 ; RUN: %llc_dwarf -O0 -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
2 ; RUN: %llc_dwarf -O0 -filetype=obj < %s | llvm-dwarfdump -debug-info - | FileCheck %s
33
44 ; The formal parameter 'b' for Function 'x' when inlined within 'a' is lost on
55 ; mips and powerpc64 (and on x86_64 at at least -O2). Presumably this is a
0 ; RUN: llc -filetype=asm -asm-verbose=0 -O0 < %s | FileCheck %s
1 ; RUN: llc -filetype=obj -O0 < %s | llvm-dwarfdump -debug-dump=line - | FileCheck %s --check-prefix=INT
1 ; RUN: llc -filetype=obj -O0 < %s | llvm-dwarfdump -debug-line - | FileCheck %s --check-prefix=INT
22
33 ; Check that the assembly output properly handles is_stmt changes. And since
44 ; we're testing anyway, check the integrated assembler too.
0 ; REQUIRES: object-emission
11
2 ; RUN: %llc_dwarf -O0 -filetype=obj -dwarf-linkage-names=All < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
2 ; RUN: %llc_dwarf -O0 -filetype=obj -dwarf-linkage-names=All < %s | llvm-dwarfdump -debug-info - | FileCheck %s
33
44 ; Generated from clang with the following source:
55 ; namespace ns {
0 ; REQUIRES: object-emission
11
2 ; RUN: %llc_dwarf -O0 -filetype=obj -dwarf-linkage-names=All < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
2 ; RUN: %llc_dwarf -O0 -filetype=obj -dwarf-linkage-names=All < %s | llvm-dwarfdump -debug-info - | FileCheck %s
33
44 ; Generate from clang with the following source. Note that the definition of
55 ; the inline function follows its use to workaround another bug that should be
0 ; REQUIRES: object-emission
11
2 ; RUN: %llc_dwarf -filetype=obj -O0 < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
2 ; RUN: %llc_dwarf -filetype=obj -O0 < %s | llvm-dwarfdump -debug-info - | FileCheck %s
33
44 ; This isn't a very pretty test case - I imagine there might be other ways to
55 ; tickle the optimizers into producing the desired code, but I haven't found
0 ; REQUIRES: object-emission
11
2 ; RUN: %llc_dwarf -dwarf-version=2 -O0 -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck --check-prefix=CHECK --check-prefix=V2 %s
3 ; RUN: %llc_dwarf -dwarf-version=3 -O0 -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck --check-prefix=CHECK --check-prefix=V3 %s
2 ; RUN: %llc_dwarf -dwarf-version=2 -O0 -filetype=obj < %s | llvm-dwarfdump -debug-info - | FileCheck --check-prefix=CHECK --check-prefix=V2 %s
3 ; RUN: %llc_dwarf -dwarf-version=3 -O0 -filetype=obj < %s | llvm-dwarfdump -debug-info - | FileCheck --check-prefix=CHECK --check-prefix=V3 %s
44
55 ; CHECK: DW_AT_name {{.*}} "dst"
66 ; V2: DW_AT_type {{.*}} {[[PTR:0x.*]]}
0 ; RUN: %llc_dwarf %s -filetype=obj -o %t
1 ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
1 ; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s
22 ; CHECK: DW_TAG_compile_unit
33 ; CHECK: DW_AT_GNU_dwo_id {{.*}}abcd
44 ; CHECK: DW_AT_GNU_dwo_name {{.*}}"my.dwo"
0 ; REQUIRES: object-emission
11
2 ; RUN: %llc_dwarf -O0 -filetype=obj %s -o - | llvm-dwarfdump -debug-dump=info - | FileCheck %s
2 ; RUN: %llc_dwarf -O0 -filetype=obj %s -o - | llvm-dwarfdump -debug-info - | FileCheck %s
33 ; Use correct signedness when emitting constants of derived (sugared) types.
44
55 ; CHECK: DW_AT_const_value [DW_FORM_sdata] (42)
0 ; REQUIRES: object-emission
11
2 ; RUN: %llc_dwarf -O0 -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
2 ; RUN: %llc_dwarf -O0 -filetype=obj < %s | llvm-dwarfdump -debug-info - | FileCheck %s
33
44 ; CHECK: DW_TAG_subprogram
55 ; CHECK: DW_AT_name {{.*}} "f"
0 ; REQUIRES: object-emission
11
22 ; RUN: %llc_dwarf -filetype=obj -O0 < %s > %t
3 ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
3 ; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s
44 ; CHECK: [[TYPE:.*]]: DW_TAG_structure_type
55 ; Make sure we correctly handle containing type of a struct being a type identifier.
66 ; CHECK-NEXT: DW_AT_containing_type [DW_FORM_ref4] (cu + {{.*}} => {[[TYPE]]})
0 ; REQUIRES: object-emission
11
22 ; RUN: %llc_dwarf -filetype=obj -O0 < %s > %t
3 ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
3 ; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s
44 ; CHECK: DW_TAG_ptr_to_member_type
55 ; CHECK-NEXT: DW_AT_type [DW_FORM_ref4] (cu + {{.*}} => {[[TYPE:0x[0-9a-f]+]]})
66 ; CHECK: [[TYPE]]: DW_TAG_base_type
55 ; REQUIRES: object-emission
66
77 ; RUN: %llc_dwarf %s -o %t -filetype=obj -O0
8 ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
8 ; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s
99
1010 ; ModuleID = 'test.bc'
1111
0 ; REQUIRES: object-emission
11
2 ; RUN: %llc_dwarf -O0 -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
2 ; RUN: %llc_dwarf -O0 -filetype=obj < %s | llvm-dwarfdump -debug-info - | FileCheck %s
33
44 ; From source:
55 ; typedef void x;
0 ; RUN: %llc_dwarf -O0 -filetype=obj -o %t.o %s
1 ; RUN: llvm-dwarfdump -debug-dump=info %t.o | FileCheck %s
1 ; RUN: llvm-dwarfdump -debug-info %t.o | FileCheck %s
22 ; REQUIRES: object-emission
33 ;
44 ; Test debug info for variadic function arguments.
0 # RUN: llc -start-before=livedebugvalues -filetype=obj -o - %s | \
1 # RUN: llvm-dwarfdump -debug-dump=info - | FileCheck %s
1 # RUN: llvm-dwarfdump -debug-info - | FileCheck %s
22 # CHECK: .debug_info contents:
33 # CHECK: DW_TAG_variable
44 # CHECK-NEXT: DW_AT_location
None # RUN: llc -filetype=obj -o - %s | llvm-dwarfdump --debug-dump=info - | FileCheck %s
0 # RUN: llc -filetype=obj -o - %s | llvm-dwarfdump --debug-info - | FileCheck %s
11 # CHECK: .debug_info contents:
22 # CHECK: DW_TAG_variable
33 # CHECK-NEXT: DW_AT_location {{.*}} (DW_OP_reg1 RDX, DW_OP_bit_piece 0x8 0x8)
0 ; RUN: llc -march=mips -mcpu=mips32r2 -O1 -filetype=obj -relocation-model=pic <%s | \
1 ; RUN: llvm-dwarfdump -debug-dump=all - | FileCheck %s
1 ; RUN: llvm-dwarfdump -all - | FileCheck %s
22
33 ; void foo(int *);
44 ;
0 ; RUN: llc -march=mips -mcpu=mips32r2 -O0 -filetype=obj -fast-isel=0 <%s | \
1 ; RUN: llvm-dwarfdump -debug-dump=all - | FileCheck %s
1 ; RUN: llvm-dwarfdump -all - | FileCheck %s
22
33 declare void @llvm.dbg.declare(metadata, metadata, metadata)
44
0 ; RUN: llc -mtriple=mips-linux-gnu -filetype=asm -asm-verbose=0 -O0 -relocation-model=pic < %s | FileCheck %s
1 ; RUN: llc -mtriple=mips-linux-gnu -filetype=obj -O0 < %s | llvm-dwarfdump -debug-dump=line - | FileCheck %s --check-prefix=INT
1 ; RUN: llc -mtriple=mips-linux-gnu -filetype=obj -O0 < %s | llvm-dwarfdump -debug-line - | FileCheck %s --check-prefix=INT
22
33 ; Mips used to generate 'jumpy' debug line info around calls. The address
44 ; calculation for each call to f1() would share the same line info so it would
None ; RUN: llc -filetype=obj -O0 < %s -mtriple sparc64-unknown-linux-gnu | llvm-dwarfdump - -debug-dump=loc | FileCheck %s
0 ; RUN: llc -filetype=obj -O0 < %s -mtriple sparc64-unknown-linux-gnu | llvm-dwarfdump - --debug-loc | FileCheck %s
11 ; The undescribable 128-bit register should be split into two 64-bit registers.
22 ; CHECK: {{.*}} - {{.*}}: DW_OP_regx D0, DW_OP_piece 0x8, DW_OP_regx D1, DW_OP_piece 0x8
33
0 ; RUN: llc -mtriple=s390x-linux-gnu -disable-fp-elim < %s | FileCheck %s
11 ; RUN: llc -mtriple=s390x-linux-gnu -disable-fp-elim -filetype=obj < %s \
2 ; RUN: | llvm-dwarfdump -debug-dump=info - | FileCheck --check-prefix=DEBUG %s
2 ; RUN: | llvm-dwarfdump -debug-info - | FileCheck --check-prefix=DEBUG %s
33 ;
44 ; This is a regression test making sure the location of variables is correct in
55 ; debugging information, even if they're addressed via the frame pointer.
0 ; RUN: llc -mtriple=x86_64-pc-linux-gnu %s -o %t -filetype=obj
1 ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
1 ; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s
22
33 ; ModuleID = 'test.c'
44
0 ; RUN: llc -mtriple=x86_64-apple-macosx10.7 %s -o %t -filetype=obj
1 ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
1 ; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s
22
33 ; CHECK: b_ref
44 ; CHECK-NOT: AT_bit_size
0 ; ModuleID = '/Volumes/Data/apple-internal/llvm/tools/clang/test/Modules/debug-info-moduleimport.m'
11 ; RUN: llc %s -o %t -filetype=obj
2 ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
2 ; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s
33 ; CHECK: DW_TAG_module
44 ; CHECK-NEXT: DW_AT_name {{.*}}"DebugModule"
55 ; CHECK-NEXT: DW_AT_LLVM_config_macros {{.*}}"-DMODULES=0"
0 source_filename = "test/DebugInfo/X86/DIModuleContext.ll"
11 target triple = "x86_64-apple-macosx"
22 ; RUN: %llc_dwarf %s -o - -filetype=obj \
3 ; RUN: | llvm-dwarfdump -debug-dump=info - | FileCheck %s
3 ; RUN: | llvm-dwarfdump -debug-info - | FileCheck %s
44 ; CHECK: DW_TAG_module
55 ; CHECK-NOT: NULL
66 ; CHECK: DW_TAG_structure_type
0 ; RUN: llc -mtriple=x86_64-apple-darwin %s -o %t -filetype=obj
1 ; RUN: llvm-dwarfdump -debug-dump=all %t | FileCheck %s
1 ; RUN: llvm-dwarfdump -all %t | FileCheck %s
22
33 ; Checks that we don't emit a size for a pointer type.
44 ; CHECK: DW_TAG_pointer_type
0 ; RUN: llc -mtriple=x86_64-apple-macosx %s -o %t -filetype=obj
1 ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
1 ; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s
22 ;
33 ; struct A {
44 ; A(int i);
0 ; RUN: llc -mtriple=x86_64-apple-darwin %s -o %t -filetype=obj
1 ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
1 ; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s
22
33 ; CHECK: DW_TAG_formal_parameter [
44 ; CHECK-NOT: ""
0 ; RUN: llc -mtriple=x86_64-apple-darwin %s -o %t -filetype=obj
1 ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
1 ; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s
22
33 ; test that the DW_AT_specification is a back edge in the file.
44
0 ; RUN: llc -mtriple=i686-w64-mingw32 -o %t -filetype=obj %s
1 ; RUN: llvm-dwarfdump -debug-dump=all %t | FileCheck %s
1 ; RUN: llvm-dwarfdump -all %t | FileCheck %s
22 ; RUN: llc -mtriple=i686-w64-mingw32 -o %t -filetype=obj -dwarf-version=3 %s
3 ; RUN: llvm-dwarfdump -debug-dump=all %t | FileCheck %s -check-prefix=DWARF3
3 ; RUN: llvm-dwarfdump -all %t | FileCheck %s -check-prefix=DWARF3
44
55 ; CHECK: DW_AT_stmt_list [DW_FORM_sec_offset]
66 ; DWARF3: DW_AT_stmt_list [DW_FORM_data4]
0 ; RUN: llc -mtriple=x86_64-apple-darwin %s -o %t -filetype=obj
1 ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
1 ; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s
22
33 ; Check that the friend tag is there and is followed by a DW_AT_friend that has a reference back.
44
0 ; PR31381: An assertion in the DWARF backend when fragments in MMI slots are
11 ; sorted by largest offset first.
2 ; RUN: llc -mtriple=x86_64-apple-darwin -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
2 ; RUN: llc -mtriple=x86_64-apple-darwin -filetype=obj < %s | llvm-dwarfdump -debug-info - | FileCheck %s
33 ; CHECK: DW_TAG_formal_parameter
44 ; CHECK: DW_TAG_formal_parameter
55 ; CHECK-NEXT: DW_AT_location [DW_FORM_exprloc] (DW_OP_fbreg -8, DW_OP_piece 0x3, DW_OP_piece 0x6, DW_OP_fbreg -3, DW_OP_piece 0x3)
None ; RUN: llc -filetype=obj -o - < %s | llvm-dwarfdump - -debug-dump=loc | FileCheck %s
0 ; RUN: llc -filetype=obj -o - < %s | llvm-dwarfdump - --debug-loc | FileCheck %s
11 ;
22 ; Created using clang -g -O3 from:
33 ; struct S0 {
None ; RUN: %llc_dwarf -filetype=obj %s -o - | llvm-dwarfdump -debug-dump=info - | FileCheck %s
0 ; RUN: %llc_dwarf -filetype=obj %s -o - | llvm-dwarfdump -debug-info - | FileCheck %s
11 ; Generated at -O2 from:
22 ; void f();
33 ; __attribute__((always_inline)) void g() {
None ; RUN: %llc_dwarf -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
0 ; RUN: %llc_dwarf -filetype=obj < %s | llvm-dwarfdump -debug-info - | FileCheck %s
11 ; REQUIRES: object-emission
22
33 ; Generated by clang -c -g -std=c11 -S -emit-llvm from the following C11 source
None ; RUN: %llc_dwarf -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
0 ; RUN: %llc_dwarf -filetype=obj < %s | llvm-dwarfdump -debug-info - | FileCheck %s
11 ; REQUIRES: object-emission
22
33 ; Generated by clang++ -c -g -std=c++11 -S -emit-llvm from the following C++11 source
None ; RUN: %llc_dwarf -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
0 ; RUN: %llc_dwarf -filetype=obj < %s | llvm-dwarfdump -debug-info - | FileCheck %s
11 ; REQUIRES: object-emission
22
33 ; typedef struct __attribute__((aligned (128))) {
0 ; RUN: llc %s -mtriple=x86_64-pc-linux-gnu -O0 -filetype=obj -o %t
1 ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
1 ; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s
22
33 ; If stack is realigned, we shouldn't describe locations of local
44 ; variables by giving offset from the frame pointer (%rbp):
0 ; REQUIRES: object-emission
11
2 ; RUN: llc -mtriple=x86_64-linux -O0 -filetype=obj -generate-arange-section < %s | llvm-dwarfdump -debug-dump=aranges - | FileCheck %s
2 ; RUN: llc -mtriple=x86_64-linux -O0 -filetype=obj -generate-arange-section < %s | llvm-dwarfdump -debug-aranges - | FileCheck %s
33 ; RUN: llc -mtriple=x86_64-linux -O0 -filetype=obj -generate-arange-section < %s | llvm-readobj --relocations - | FileCheck --check-prefix=OBJ %s
44
55 ; extern int i;
1212 ; }
1313 ;
1414 ; RUN: llc -filetype=asm %s -o - | FileCheck %s
15 ; RUN: llc -filetype=obj %s -o - | llvm-dwarfdump - --debug-dump=info | FileCheck %s --check-prefix=DWARF
15 ; RUN: llc -filetype=obj %s -o - | llvm-dwarfdump - ---debug-info | FileCheck %s --check-prefix=DWARF
1616
1717 ; CHECK-LABEL: _main:
1818 ; CHECK: movaps {{.*}}, (%rsp)
None ; RUN: %llc_dwarf -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
0 ; RUN: %llc_dwarf -filetype=obj < %s | llvm-dwarfdump -debug-info - | FileCheck %s
11 ; REQUIRES: object-emission
22
33 ; Generated by clang -c -g -std=c11 -S -emit-llvm from the following C11 source
None ; RUN: %llc_dwarf -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
0 ; RUN: %llc_dwarf -filetype=obj < %s | llvm-dwarfdump -debug-info - | FileCheck %s
11 ; REQUIRES: object-emission
22
33 ; Generated by clang -c -g -std=c11 -S -emit-llvm from the following C11 source
0 ; RUN: llc -mtriple x86_64-apple-macosx -O0 -filetype=obj -o - %s \
1 ; RUN: | llvm-dwarfdump -debug-dump=info - | FileCheck %s
1 ; RUN: | llvm-dwarfdump -debug-info - | FileCheck %s
22 ; RUN: llc -mtriple x86_64-gnu-linux -O0 -filetype=obj -o - %s \
3 ; RUN: | llvm-dwarfdump -debug-dump=info - | FileCheck %s --check-prefix=LINUX
3 ; RUN: | llvm-dwarfdump -debug-info - | FileCheck %s --check-prefix=LINUX
44 ; LINUX-NOT: DW_AT_data_bit_offset
55 ;
66 ; Generated from:
0 ; RUN: llc -mtriple x86_64-apple-macosx -O0 -filetype=obj -o %t_le.o %s
1 ; RUN: llvm-dwarfdump -debug-dump=info %t_le.o | FileCheck %s
1 ; RUN: llvm-dwarfdump -debug-info %t_le.o | FileCheck %s
22
33 ; Produced at -O0 from:
44 ; struct bitfield {
0 ; RUN: llc %s -o %t -filetype=obj
1 ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
1 ; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s
22
33 ; Checks that we emit debug info for the block variable declare.
44 ; CHECK: DW_TAG_subprogram
0 ; RUN: llc -mtriple=x86_64-apple-macosx10.8.0 -O0 -filetype=obj -o %t %s
1 ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
1 ; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s
22 ; Test that we generate debug info for by-value struct args that are not used.
33 ;
44 ; CHECK: DW_TAG_formal_parameter
0 ; REQUIRES: object-emission
11
2 ; RUN: llc -o - %s -filetype=obj -O0 -generate-dwarf-pub-sections=Disable -generate-type-units -mtriple=x86_64-unknown-linux-gnu | llvm-dwarfdump -debug-dump=types - | FileCheck %s
2 ; RUN: llc -o - %s -filetype=obj -O0 -generate-dwarf-pub-sections=Disable -generate-type-units -mtriple=x86_64-unknown-linux-gnu | llvm-dwarfdump -debug-types - | FileCheck %s
33
44 ; struct foo {
55 ; } f;
0 ; RUN: llc -mtriple=x86_64-apple-darwin %s -o - -filetype=obj \
1 ; RUN: | llvm-dwarfdump -debug-dump=info - | FileCheck %s
1 ; RUN: | llvm-dwarfdump -debug-info - | FileCheck %s
22
33 ; Clang modules leave Skeleton CUs as breadcrumbs to point from the object files
44 ; to the pcm containing the module's debug info.
None ; RUN: llc -mtriple=x86_64-linux < %s -filetype=obj | llvm-dwarfdump -debug-dump=info - | FileCheck %s
0 ; RUN: llc -mtriple=x86_64-linux < %s -filetype=obj | llvm-dwarfdump -debug-info - | FileCheck %s
11
22 ; test that we add DW_AT_inline even when we only have concrete out of line
33 ; instances.
0 ; RUN: llc %s -filetype=obj -o %t.o
1 ; RUN: llvm-dwarfdump -debug-dump=info %t.o | FileCheck %s
1 ; RUN: llvm-dwarfdump -debug-info %t.o | FileCheck %s
22 ; Test emitting a constant for an aggregate type.
33 ;
44 ; clang -S -O1 -emit-llvm
None ; RUN: %llc_dwarf -filetype=obj %s -o - | llvm-dwarfdump -debug-dump=info - | FileCheck %s
0 ; RUN: %llc_dwarf -filetype=obj %s -o - | llvm-dwarfdump -debug-info - | FileCheck %s
11
22 ; A hand-written testcase to check 64-bit constant handling in location lists.
33
0 ; RUN: llc -split-dwarf-file=foo.dwo -O0 %s -mtriple=x86_64-unknown-linux-gnu -filetype=obj -o %t
1 ; RUN: llvm-dwarfdump -debug-dump=all %t | FileCheck %s
1 ; RUN: llvm-dwarfdump -all %t | FileCheck %s
22 ; RUN: llvm-readobj --relocations %t | FileCheck --check-prefix=CHECK-RELOCS %s
33
44 ; From:
0 ; RUN: llc -split-dwarf-file=foo.dwo -O0 %s -function-sections -mtriple=x86_64-unknown-linux-gnu -filetype=obj -o %t
1 ; RUN: llvm-dwarfdump -debug-dump=abbrev %t | FileCheck --check-prefix=FUNCTION-SECTIONS %s
1 ; RUN: llvm-dwarfdump -debug-abbrev %t | FileCheck --check-prefix=FUNCTION-SECTIONS %s
22 ; RUN: llvm-readobj --relocations %t | FileCheck --check-prefix=FUNCTION-SECTIONS-RELOCS %s
33
44 ; RUN: llc -split-dwarf-file=foo.dwo -O0 %s -mtriple=x86_64-unknown-linux-gnu -filetype=obj -o %t
5 ; RUN: llvm-dwarfdump -debug-dump=abbrev %t | FileCheck --check-prefix=NO-FUNCTION-SECTIONS %s
5 ; RUN: llvm-dwarfdump -debug-abbrev %t | FileCheck --check-prefix=NO-FUNCTION-SECTIONS %s
66
77 ; From:
88 ; int foo (int a) {
None ; RUN: llc -mtriple=x86_64-linux -O0 -o - -filetype=obj < %s | llvm-dwarfdump -debug-dump=info -| FileCheck %s
1 ; RUN: llc -mtriple=x86_64-linux -dwarf-version=2 -O0 -o - -filetype=obj < %s | llvm-dwarfdump -debug-dump=info -| FileCheck -check-prefix=DWARF2 %s
0 ; RUN: llc -mtriple=x86_64-linux -O0 -o - -filetype=obj < %s | llvm-dwarfdump -debug-info -| FileCheck %s
1 ; RUN: llc -mtriple=x86_64-linux -dwarf-version=2 -O0 -o - -filetype=obj < %s | llvm-dwarfdump -debug-info -| FileCheck -check-prefix=DWARF2 %s
22
33 ; Generated from Clang with the following source:
44 ;
None ; RUN: llc < %s -filetype=obj | llvm-dwarfdump - -debug-dump=info | FileCheck %s
0 ; RUN: llc < %s -filetype=obj | llvm-dwarfdump - --debug-info | FileCheck %s
11 ;
22 ; IR module created as follows:
33 ; clang -emit-llvm -S db-abs-1.cpp -o db-abs-1.ll -g
0 ; RUN: llc -mtriple=x86_64-apple-darwin12 -filetype=obj < %s \
1 ; RUN: | llvm-dwarfdump -debug-dump=info - | FileCheck %s
1 ; RUN: | llvm-dwarfdump -debug-info - | FileCheck %s
22 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
33 target triple = "x86_64-apple-macosx10.6.7"
44 ; Radar 9511391
0 ; RUN: llc < %s | FileCheck %s
1 ; RUN: llc < %s -filetype=obj | llvm-dwarfdump - -debug-dump=info | FileCheck %s --check-prefix=DWARF
1 ; RUN: llc < %s -filetype=obj | llvm-dwarfdump - --debug-info | FileCheck %s --check-prefix=DWARF
22
33 ; This should use the frame index side table for allocas, not DBG_VALUE
44 ; instructions. For SDAG ISel, this test would see an SDNode materializing the
0 ; RUN: llc < %s -O0 -mtriple x86_64-apple-darwin | FileCheck %s
11 ; RUN: llc < %s -O0 -mtriple x86_64-apple-darwin -filetype=obj \
2 ; RUN: | llvm-dwarfdump - -debug-dump=info | FileCheck %s --check-prefix=DWARF
2 ; RUN: | llvm-dwarfdump - --debug-info | FileCheck %s --check-prefix=DWARF
33 ;
44
55 ; CHECK-LABEL: _foo:
0 ; RUN: llc < %s -o %t -filetype=obj
1 ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
1 ; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s
22 ; RUN: llc < %s -o %t -filetype=obj -regalloc=basic
3 ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
3 ; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s
44
55 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
66 target triple = "x86_64-apple-darwin8"
None ; RUN: llc -O1 -filetype=obj -o - %s | llvm-dwarfdump -debug-dump=all - | FileCheck %s
0 ; RUN: llc -O1 -filetype=obj -o - %s | llvm-dwarfdump -all - | FileCheck %s
11 ; Generated with -O1 from:
22 ; int f1();
33 ; void f2(int*);
None ; RUN: llc < %s -filetype=obj | llvm-dwarfdump - -debug-dump=info | FileCheck %s
0 ; RUN: llc < %s -filetype=obj | llvm-dwarfdump - --debug-info | FileCheck %s
11 ;
22 ; IR module created as follows:
33 ; clang -emit-llvm -S -O2 foo.cpp -o foo.ll -g
0 ; RUN: llc -mtriple=x86_64-apple-darwin < %s -filetype=obj \
1 ; RUN: | llvm-dwarfdump -debug-dump=info - | FileCheck --check-prefix=CHECK --check-prefix=DARWIN %s
1 ; RUN: | llvm-dwarfdump -debug-info - | FileCheck --check-prefix=CHECK --check-prefix=DARWIN %s
22 ; RUN: llc -mtriple=x86_64-linux-gnu < %s -filetype=obj \
3 ; RUN: | llvm-dwarfdump -debug-dump=info - | FileCheck --check-prefix=CHECK --check-prefix=LINUX %s
3 ; RUN: | llvm-dwarfdump -debug-info - | FileCheck --check-prefix=CHECK --check-prefix=LINUX %s
44 ; RUN: llc -mtriple=x86_64-apple-darwin < %s -filetype=obj -regalloc=basic \
5 ; RUN: | llvm-dwarfdump -debug-dump=info - | FileCheck --check-prefix=CHECK --check-prefix=DARWIN %s
5 ; RUN: | llvm-dwarfdump -debug-info - | FileCheck --check-prefix=CHECK --check-prefix=DARWIN %s
66
77 ; CHECK: DW_TAG_subprogram
88 ; CHECK: DW_AT_abstract_origin {{.*}} "foo"
None ; RUN: llc -filetype=obj %s -o - | llvm-dwarfdump -debug-dump=info - | FileCheck %s
1 ; RUN: llc -filetype=obj %s -regalloc=basic -o - | llvm-dwarfdump -debug-dump=info - | FileCheck %s
0 ; RUN: llc -filetype=obj %s -o - | llvm-dwarfdump -debug-info - | FileCheck %s
1 ; RUN: llc -filetype=obj %s -regalloc=basic -o - | llvm-dwarfdump -debug-info - | FileCheck %s
22 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
33 target triple = "x86_64-apple-darwin10.0.0"
44 ; Test that the type for the formal parameter "var" makes it into the debug info.
0 ; RUN: llc -mtriple=x86_64-apple-darwin %s -o %t -filetype=obj
1 ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
1 ; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s
22 ;
33 ; Test the DW_AT_accessibility DWARF attribute.
44 ;
0 ; RUN: llc -mtriple x86_64-apple-darwin -filetype=obj -o %t.o < %s
1 ; RUN: llvm-dwarfdump -debug-dump=info %t.o | FileCheck %s
1 ; RUN: llvm-dwarfdump -debug-info %t.o | FileCheck %s
22
33 ; Generated from llvm/tools/clang/test/CodeGenObjC/debug-info-blocks.m
44 ; rdar://problem/9279956
33 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
44 target triple = "x86_64-apple-darwin"
55 ; RUN: %llc_dwarf -O0 -filetype=obj -o %t.o %s
6 ; RUN: llvm-dwarfdump -debug-dump=info %t.o | FileCheck %s
6 ; RUN: llvm-dwarfdump -debug-info %t.o | FileCheck %s
77 ; REQUIRES: object-emission
88
99 ; // ---------------------------------------------------------------------
0 ; RUN: llc -mtriple=x86_64-unknown-linux-gnu %s -o %t -filetype=obj
1 ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
1 ; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s
22 ;
33 ; Test the DW_AT_producer DWARG attribute.
44 ; When producer and flags are both given in DIComileUnit, set DW_AT_producer
0 ; RUN: llc %s -o %t -filetype=obj -O0 -mtriple=x86_64-unknown-linux-gnu -dwarf-version=4
1 ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s -check-prefix=PRESENT
2 ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s -check-prefix=ABSENT
1 ; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s -check-prefix=PRESENT
2 ; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s -check-prefix=ABSENT
33 ; RUN: llc %s -o %t -filetype=obj -O0 -mtriple=x86_64-apple-darwin -dwarf-version=4
4 ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s -check-prefix=DARWINP
5 ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s -check-prefix=DARWINA
4 ; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s -check-prefix=DARWINP
5 ; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s -check-prefix=DARWINA
66 ; Verify that attributes we do want are PRESENT;
77 ; verify that attributes we don't want are ABSENT.
88 ; It's a lot easier to do this in two passes than in one.
0 ; RUN: llc -O0 -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s
11 ; RUN: llc -O0 -mtriple=x86_64-unknown-linux-gnu -filetype=obj < %s \
2 ; RUN: | llvm-dwarfdump -debug-dump=info - | FileCheck %s --check-prefix=DWARF
2 ; RUN: | llvm-dwarfdump -debug-info - | FileCheck %s --check-prefix=DWARF
33
44 ; Verify that we have correct debug info for local variables in code
55 ; instrumented with AddressSanitizer.
0 ; RUN: llc -mtriple=x86_64-apple-darwin -O0 -filetype=obj -dwarf-version 4 \
1 ; RUN: -o - < %s | llvm-dwarfdump - -debug-dump=info \
1 ; RUN: -o - < %s | llvm-dwarfdump - --debug-info \
22 ; RUN: | FileCheck %s -check-prefixes=CHECK,DWARF4
33 ; RUN: llc -mtriple=x86_64-apple-darwin -O0 -filetype=obj -dwarf-version 5 \
4 ; RUN: -o - < %s | llvm-dwarfdump - -debug-dump=info \
4 ; RUN: -o - < %s | llvm-dwarfdump - --debug-info \
55 ; RUN: | FileCheck %s -check-prefixes=CHECK,DWARF5
66
77 ; Check that we can omit default array lower-bounds.
0 ; RUN: llc -mtriple=i386-unknown-unknown -mcpu=core2 %s -o %t -filetype=obj
1 ; RUN: llvm-dwarfdump -debug-dump=line %t | FileCheck %s
1 ; RUN: llvm-dwarfdump -debug-line %t | FileCheck %s
22 ;
33 ; Generated from:
44 ;
0 ; RUN: llc -mtriple=i386-unknown-unknown -mcpu=core2 %s -o %t -filetype=obj
1 ; RUN: llvm-dwarfdump -debug-dump=line %t | FileCheck %s
1 ; RUN: llvm-dwarfdump -debug-line %t | FileCheck %s
22 ;
33 ; Generated from:
44 ;
0 ; RUN: llc -mtriple=i386-unknown-unknown -mcpu=core2 %s -o %t -filetype=obj
1 ; RUN: llvm-dwarfdump -debug-dump=line %t | FileCheck %s
1 ; RUN: llvm-dwarfdump -debug-line %t | FileCheck %s
22 ;
33 ; Generated from:
44 ;
None ; RUN: llc -mtriple=i686-pc-windows-msvc -O0 -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
0 ; RUN: llc -mtriple=i686-pc-windows-msvc -O0 -filetype=obj < %s | llvm-dwarfdump -debug-info - | FileCheck %s
11
22 ; CHECK-NOT: DW_AT_location
33
None ; RUN: llc -mtriple=x86_64-apple-darwin -O0 -filetype=obj -o - < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
0 ; RUN: llc -mtriple=x86_64-apple-darwin -O0 -filetype=obj -o - < %s | llvm-dwarfdump -debug-info - | FileCheck %s
11 ; PR33157. Don't crash on duplicate dbg.declare.
22 ; CHECK: DW_TAG_formal_parameter
33 ; CHECK: DW_AT_location [DW_FORM_exprloc]
0 ; RUN: llc -mtriple=x86_64-pc-linux-gnu -filetype=obj -o %t.o < %s
1 ; RUN: llvm-dwarfdump -debug-dump=pubnames %t.o | FileCheck --check-prefix=LINUX %s
1 ; RUN: llvm-dwarfdump -debug-pubnames %t.o | FileCheck --check-prefix=LINUX %s
22 ; RUN: llc -mtriple=x86_64-apple-darwin12 -filetype=obj -o %t.o < %s
3 ; RUN: llvm-dwarfdump -debug-dump=pubnames %t.o | FileCheck --check-prefix=NOPUB %s
3 ; RUN: llvm-dwarfdump -debug-pubnames %t.o | FileCheck --check-prefix=NOPUB %s
44 ; RUN: llc -mtriple=x86_64-scei-ps4 -filetype=obj -o %t.o < %s
5 ; RUN: llvm-dwarfdump -debug-dump=pubnames %t.o | FileCheck --check-prefix=NOPUB %s
5 ; RUN: llvm-dwarfdump -debug-pubnames %t.o | FileCheck --check-prefix=NOPUB %s
66 ; ModuleID = 'dwarf-public-names.cpp'
77 ;
88 ; Generated from:
0 ; RUN: llc -mtriple=x86_64-unknown-linux-gnu %s -o %t -filetype=obj
1 ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
1 ; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s
22 ; RUN: llvm-as < %s | llvm-dis | FileCheck --check-prefix=CHECK-DIS %s
33
44 ; CHECK: 0x0000000b: DW_TAG_compile_unit
0 ; RUN: llc -mtriple=x86_64-apple-darwin -O0 -filetype=obj -o %t < %s
1 ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
1 ; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s
22 ;
33
44 %struct.foo = type { i32, [1 x i32] }
0 ; RUN: llc -mtriple=x86_64-apple-darwin -O0 -filetype=obj -o %t < %s
1 ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
1 ; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s
22 ;
33
44 source_filename = "test/DebugInfo/X86/empty-array.ll"
0 ; RUN: llc -mtriple=x86_64-apple-darwin -filetype=obj %s -o %t
1 ; RUN: llvm-dwarfdump -debug-dump=line %t | FileCheck %s
1 ; RUN: llvm-dwarfdump -debug-line %t | FileCheck %s
22
33 ; Check that the line table starts at 7, not 4, but that the first
44 ; statement isn't until line 8.
0 ; RUN: llc -O0 -mtriple=x86_64-apple-darwin %s -o %t -filetype=obj
1 ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
1 ; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s
22
33 source_filename = "test/DebugInfo/X86/enum-class.ll"
44
0 ; RUN: llc -O0 -mtriple=x86_64-apple-darwin %s -o %t -filetype=obj
1 ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
1 ; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s
22
33 source_filename = "test/DebugInfo/X86/enum-fwd-decl.ll"
44
0 ; RUN: llc -mtriple=x86_64-apple-darwin -o - %s -filetype=obj \
1 ; RUN: | llvm-dwarfdump -debug-dump=info - | FileCheck %s
1 ; RUN: | llvm-dwarfdump -debug-info - | FileCheck %s
22 ; A hand-crafted FrameIndex location with a DW_OP_deref.
33 ; CHECK: DW_TAG_formal_parameter
44 ; fbreg -8, deref
0 ; RUN: llc -split-dwarf-file=baz.dwo -O0 %s -mtriple=x86_64-unknown-linux-gnu -filetype=obj -o %t
1 ; RUN: llvm-dwarfdump -debug-dump=all %t | FileCheck %s
1 ; RUN: llvm-dwarfdump -all %t | FileCheck %s
22 ; RUN: llvm-readobj --relocations %t | FileCheck --check-prefix=OBJ %s
33 ; RUN: llvm-objdump -h %t | FileCheck --check-prefix=HDR %s
44
0 ; RUN: llc -split-dwarf-file=foo.dwo -O0 %s -mtriple=x86_64-unknown-linux-gnu -filetype=obj -o %t
1 ; RUN: llvm-dwarfdump -debug-dump=all %t | FileCheck %s
1 ; RUN: llvm-dwarfdump -all %t | FileCheck %s
22
33 ; The source is an empty file, modified to include/retain an 'int' type, since empty CUs are omitted.
44
0 ; RUN: llc -split-dwarf-file=foo.dwo -O0 < %s -mtriple=x86_64-unknown-linux-gnu -filetype=obj > %t
1 ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
1 ; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s
22 ; RUN: llvm-objdump -r %t | FileCheck --check-prefix=RELOCS %s
33
44 ; Test the emission of gmlt-like inlining information into the skeleton unit.
None ; RUN: llc -split-dwarf-file=foo.dwo -O0 < %s -mtriple=x86_64-unknown-linux-gnu -filetype=obj | llvm-dwarfdump -debug-dump=info - | FileCheck %s
0 ; RUN: llc -split-dwarf-file=foo.dwo -O0 < %s -mtriple=x86_64-unknown-linux-gnu -filetype=obj | llvm-dwarfdump -debug-info - | FileCheck %s
11
22 ; CHECK-NOT: DW_TAG_subprogram
33
None ; RUN: llc < %s -filetype=obj | llvm-dwarfdump -debug-dump=info - | FileCheck %s
0 ; RUN: llc < %s -filetype=obj | llvm-dwarfdump -debug-info - | FileCheck %s
11 ; from (at -Os):
22 ; void foo() {
33 ; float a = 3.14;
1313 ;
1414 ; RUN: opt %s -O2 -S -o %t
1515 ; RUN: cat %t | FileCheck --check-prefix=LOWERING %s
16 ; RUN: llc -filetype=obj %t -o - | llvm-dwarfdump -debug-dump=info - | FileCheck %s
16 ; RUN: llc -filetype=obj %t -o - | llvm-dwarfdump -debug-info - | FileCheck %s
1717 ; Test that we only emit only one DW_AT_formal_parameter "map" for this function.
1818 ; rdar://problem/14874886
1919 ;
None ; RUN: llc %s -filetype=obj -o - | llvm-dwarfdump --debug-dump=info - | FileCheck %s
0 ; RUN: llc %s -filetype=obj -o - | llvm-dwarfdump --debug-info - | FileCheck %s
11 ; CHECK: DW_TAG_variable
22 ; CHECK-NEXT: DW_AT_location [DW_FORM_exprloc] (DW_OP_fbreg +0)
33 ; CHECK-NEXT: DW_AT_name {{.*}}"i"
0 ; REQUIRES: object-emission
11
2 ; RUN: llc -mtriple=x86_64-linux -O0 -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
2 ; RUN: llc -mtriple=x86_64-linux -O0 -filetype=obj < %s | llvm-dwarfdump -debug-info - | FileCheck %s
33
44 ; From source:
55 ; struct foo {
None ; RUN: %llc_dwarf %s -o - -filetype=obj | llvm-dwarfdump -debug-dump=info - | FileCheck %s
0 ; RUN: %llc_dwarf %s -o - -filetype=obj | llvm-dwarfdump -debug-info - | FileCheck %s
11 ; Generated from:
22 ; namespace normal { inline namespace inlined { int i; } }
33 ; Check that an inline namespace is emitted with DW_AT_export_symbols
None ; RUN: llc -mtriple=x86_64-linux-gnu -fast-isel=false -filetype=obj < %s -o - | llvm-dwarfdump -debug-dump=info - | FileCheck %s
0 ; RUN: llc -mtriple=x86_64-linux-gnu -fast-isel=false -filetype=obj < %s -o - | llvm-dwarfdump -debug-info - | FileCheck %s
11 ; RUN: llc -mtriple=x86_64-linux-gnu -fast-isel=false -filetype=asm < %s -o - | FileCheck --check-prefix=ASM %s
22
33 ; Generated from:
None ; RUN: llc -mtriple=x86_64-unknown-linux-gnu -filetype=obj -O0 < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
0 ; RUN: llc -mtriple=x86_64-unknown-linux-gnu -filetype=obj -O0 < %s | llvm-dwarfdump -debug-info - | FileCheck %s
11
22 ;; This test checks that Inlined DILexicalBlockFile with local decl entry
33 ;; is skipped and only one DW_TAG_lexical_block is generated.
0 ; REQUIRES: object-emission
11
22 ; RUN: llc -mtriple=x86_64-linux -O0 -filetype=obj < %s \
3 ; RUN: | llvm-dwarfdump -debug-dump=info - | FileCheck --check-prefix=CHECK --check-prefix=CHECK-V4 %s
3 ; RUN: | llvm-dwarfdump -debug-info - | FileCheck --check-prefix=CHECK --check-prefix=CHECK-V4 %s
44 ; RUN: llc -mtriple=x86_64-linux -dwarf-version=3 -O0 -filetype=obj < %s \
5 ; RUN: | llvm-dwarfdump -debug-dump=info - | FileCheck --check-prefix=CHECK --check-prefix=CHECK-V3 %s
5 ; RUN: | llvm-dwarfdump -debug-info - | FileCheck --check-prefix=CHECK --check-prefix=CHECK-V3 %s
66
77 ; Check that we emit DW_TAG_lexical_block and that it has the right encoding
88 ; depending on the dwarf version.
0 ; RUN: llc -mtriple=x86_64-macosx %s -o %t -filetype=obj
1 ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
1 ; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s
22
33 ; CHECK: DW_TAG_subprogram [9] *
44 ; CHECK-NOT: DW_AT_{{(MIPS_)?}}linkage_name
None ; RUN: llc -mtriple=x86_64-linux-gnu -filetype=obj -o - %s | llvm-dwarfdump -debug-dump=loc - | FileCheck %s
0 ; RUN: llc -mtriple=x86_64-linux-gnu -filetype=obj -o - %s | llvm-dwarfdump -debug-loc - | FileCheck %s
11
22 ; The test inlines the function F four times, with each inlined variable for
33 ; "i4" sharing the same virtual register. This means the live interval of the
0 ; RUN: llc -mtriple=x86_64-apple-darwin -filetype=obj < %s \
1 ; RUN: | llvm-dwarfdump -debug-dump=info - | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-V4
1 ; RUN: | llvm-dwarfdump -debug-info - | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-V4
22 ; RUN: llc -mtriple=x86_64-apple-darwin -filetype=obj -dwarf-version=3 < %s \
3 ; RUN: | llvm-dwarfdump -debug-dump=info - | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-V3
3 ; RUN: | llvm-dwarfdump -debug-info - | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-V3
44
55
66 ; Check that we use DW_AT_low_pc and that it has the right encoding depending
0 // RUN: llvm-mc -triple x86_64-unknown-linux-gnu -filetype obj -main-file-name foo.S -g -o %t %s
1 // RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
1 // RUN: llvm-dwarfdump -debug-info %t | FileCheck %s
22
33 // CHECK: DW_TAG_compile_unit [1]
44 // CHECK-NOT: DW_TAG_
33 ;
44 ; void (A::*p)() = &A::foo;
55 ;
6 ; RUN: llc -filetype=obj -o - %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
6 ; RUN: llc -filetype=obj -o - %s | llvm-dwarfdump -debug-info - | FileCheck %s
77 ; Check that the member function pointer is emitted without a DW_AT_size attribute.
88 ; CHECK: DW_TAG_ptr_to_member_type
99 ; CHECK-NOT: DW_AT_{{.*}}size
0 ; REQUIRES: object-emission
11
2 ; RUN: llc -mtriple=x86_64-linux-gnu -filetype=obj %s -o - | llvm-dwarfdump -debug-dump=all - | FileCheck %s
2 ; RUN: llc -mtriple=x86_64-linux-gnu -filetype=obj %s -o - | llvm-dwarfdump -all - | FileCheck %s
33
44 ; Test that we accept and generate DWARF entities for DW_TAG_structure_type,
55 ; DW_TAG_member and DW_TAG_typedef with no source location. These can come up
0 ; RUN: llc %s -o %t -filetype=obj
1 ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
1 ; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s
22 ; CHECK: DW_TAG_compile_unit
33 ; CHECK: DW_TAG_subprogram
44 ; CHECK: DW_AT_name{{.*}}"f"
0 ; RUN: llc -mtriple=x86_64-apple-darwin -O0 -filetype=obj -o %t < %s
1 ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
1 ; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s
22
33 source_filename = "test/DebugInfo/X86/nondefault-subrange-array.ll"
44
None ; RUN: llc -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
0 ; RUN: llc -filetype=obj < %s | llvm-dwarfdump -debug-info - | FileCheck %s
11 ;
22 ; PR22296: In this testcase the DBG_VALUE describing "p5" becomes unavailable
33 ; because the register its address is in is clobbered and we (currently) aren't
None ; RUN: %llc_dwarf -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
0 ; RUN: %llc_dwarf -filetype=obj < %s | llvm-dwarfdump -debug-info - | FileCheck %s
11 ; REQUIRES: object-emission
22
33 ; Generated by clang -S -c -std=c++11 --emit-llvm -g from the following C11 source:
None ; RUN: %llc_dwarf -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
0 ; RUN: %llc_dwarf -filetype=obj < %s | llvm-dwarfdump -debug-info - | FileCheck %s
11 ; REQUIRES: object-emission
22
33 ; Generated by clang++ -S -c -std=c++11 --emit-llvm -g from the following C++11 source:
None ; RUN: %llc_dwarf -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
0 ; RUN: %llc_dwarf -filetype=obj < %s | llvm-dwarfdump -debug-info - | FileCheck %s
11 ; REQUIRES: object-emission
22
33 ; Generated by clang++ -S -c --emit-llvm -g from the following ObjC source:
0 ; RUN: llc -mtriple=x86_64-macosx %s -o %t -filetype=obj
1 ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
1 ; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s
22
33 ; CHECK: DW_TAG_structure_type
44 ; CHECK: DW_AT_declaration
0 ; RUN: llc -filetype=obj -o %t.o < %s >/dev/null 2>&1
1 ; RUN: llvm-dwarfdump -debug-dump=info %t.o | FileCheck %s
1 ; RUN: llvm-dwarfdump -debug-info %t.o | FileCheck %s
22
33 ; CHECK: DW_TAG_structure_type
44 ; CHECK: DW_AT_APPLE_objc_complete_type
0 ; RUN: llc -O0 -mtriple=x86_64-apple-darwin < %s -filetype=obj \
1 ; RUN: | llvm-dwarfdump -debug-dump=info - \
1 ; RUN: | llvm-dwarfdump -debug-info - \
22 ; RUN: | FileCheck %s -check-prefix=CHECK -check-prefix=DWARF4
33 ; RUN: llc -O0 -mtriple=x86_64-apple-darwin < %s -filetype=obj -dwarf-version=3 \
4 ; RUN: | llvm-dwarfdump -debug-dump=info - \
4 ; RUN: | llvm-dwarfdump -debug-info - \
55 ; RUN: | FileCheck %s -check-prefix=CHECK -check-prefix=DWARF3
66
77 ; DWARF4: DW_AT_location [DW_FORM_sec_offset] (0x00000000
0 ; REQUIRES: object-emission
11 ;
22 ; RUN: llc -mtriple=x86_64-unknown-linux-gnu -O0 -filetype=obj < %s > %t
3 ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
3 ; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s
44
55 ; Test case derived from compiling the following source with clang -g:
66 ;
0 ; RUN: llc -O0 %s -filetype=obj -o %t.o
1 ; RUN: llvm-dwarfdump -debug-dump=loc %t.o | FileCheck %s
1 ; RUN: llvm-dwarfdump -debug-loc %t.o | FileCheck %s
22 ;
33 ; rdar://problem/15928306
44 ;
0 ; RUN: llc < %s | FileCheck %s
1 ; RUN: llc -filetype=obj < %s | llvm-dwarfdump -debug-dump=loc - | FileCheck %s --check-prefix=DWARF
1 ; RUN: llc -filetype=obj < %s | llvm-dwarfdump -debug-loc - | FileCheck %s --check-prefix=DWARF
22
33 ; Compile the following with -O1:
44
0 ; RUN: llc -mtriple=x86_64-apple-macosx10.7 %s -o %t -filetype=obj
1 ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
1 ; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s
22
33 ; CHECK: ptr
44 ; CHECK-NOT: AT_bit_size
0 ; RUN: llc -mtriple=x86_64-apple-darwin %s -o %t -filetype=obj
1 ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
1 ; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s
22
33 ; test that the DW_AT_specification is a back edge in the file.
44
0 ; RUN: llc %s -o %t -filetype=obj -mtriple=x86_64-unknown-linux-gnu
1 ; RUN: llvm-dwarfdump -debug-dump=line %t | FileCheck %s
1 ; RUN: llvm-dwarfdump -debug-line %t | FileCheck %s
22 ; PR13303
33
44 ; Check that the prologue ends with is_stmt here.
0 ; RUN: llc -mtriple=x86_64-apple-macosx10.9.0 -filetype=obj -O0 < %s \
1 ; RUN: | llvm-dwarfdump -debug-dump=info - | FileCheck %s
1 ; RUN: | llvm-dwarfdump -debug-info - | FileCheck %s
22 ; ModuleID = 'aggregate-indirect-arg.cpp'
33 ; extracted from debuginfo-tests/aggregate-indirect-arg.cpp
44
0 ; REQUIRES: object-emission
11 ; RUN: llc -O2 -filetype=obj -mtriple=x86_64-unknown-linux-gnu < %s \
2 ; RUN: | llvm-dwarfdump -debug-dump=line - | FileCheck %s
2 ; RUN: | llvm-dwarfdump -debug-line - | FileCheck %s
33 ;
44 ; Generated with clang -O2 -g from
55 ;
0 ; RUN: llc -mtriple=x86_64-apple-darwin %s -o %t -filetype=obj -O0
1 ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
1 ; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s
22
33 ; CHECK: DW_TAG_rvalue_reference_type
44
0 ; RUN: %llc_dwarf -stop-after=livedebugvalues -o - %s \
11 ; RUN: | FileCheck %s --check-prefix=SANITY
22 ; RUN: %llc_dwarf -march=x86-64 -o - %s -filetype=obj \
3 ; RUN: | llvm-dwarfdump -debug-dump=all - | FileCheck %s
3 ; RUN: | llvm-dwarfdump -all - | FileCheck %s
44 ;
55 ; CHECK: .debug_info contents:
66 ; CHECK: DW_TAG_variable
0 ; RUN: llc -mtriple=x86_64-apple-darwin -o - %s -filetype=obj \
1 ; RUN: | llvm-dwarfdump -debug-dump=info - | FileCheck %s
1 ; RUN: | llvm-dwarfdump -debug-info - | FileCheck %s
22 ; A single FI location. This used to trigger an assertion in debug libstdc++.
33 ; CHECK: DW_TAG_formal_parameter
44 ; fbreg -8
0 ; RUN: llc -mtriple=x86_64-linux -split-dwarf-cross-cu-references -split-dwarf-file=foo.dwo -filetype=obj -o %t < %s
11 ; RUN: llvm-objdump -r %t | FileCheck %s
2 ; RUN: llvm-dwarfdump -debug-dump=info.dwo %t | FileCheck --check-prefix=ALL --check-prefix=INFO --check-prefix=DWO --check-prefix=CROSS %s
3 ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck --check-prefix=ALL --check-prefix=INFO %s
2 ; RUN: llvm-dwarfdump -debug-info-dwo %t | FileCheck --check-prefix=ALL --check-prefix=INFO --check-prefix=DWO --check-prefix=CROSS %s
3 ; RUN: llvm-dwarfdump -debug-info %t | FileCheck --check-prefix=ALL --check-prefix=INFO %s
44
55 ; RUN: llc -mtriple=x86_64-linux -split-dwarf-file=foo.dwo -filetype=obj -o %t < %s
66 ; RUN: llvm-objdump -r %t | FileCheck %s
7 ; RUN: llvm-dwarfdump -debug-dump=info.dwo %t | FileCheck --check-prefix=ALL --check-prefix=DWO --check-prefix=NOCROSS %s
8 ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck --check-prefix=ALL --check-prefix=INFO %s
7 ; RUN: llvm-dwarfdump -debug-info-dwo %t | FileCheck --check-prefix=ALL --check-prefix=DWO --check-prefix=NOCROSS %s
8 ; RUN: llvm-dwarfdump -debug-info %t | FileCheck --check-prefix=ALL --check-prefix=INFO %s
99
1010 ; Testing cross-CU references for types, subprograms, and variables
1111 ; Built from code something like this:
0 ; RUN: rm -rf %t && mkdir -p %t
11 ; RUN: %llc_dwarf -split-dwarf-file=foo.dwo %s -filetype=obj -o %t/a.o
22 ; RUN: %llc_dwarf -split-dwarf-file=bar.dwo %s -filetype=obj -o %t/b.o
3 ; RUN: llvm-dwarfdump -debug-dump=info %t/a.o %t/b.o | FileCheck %s
3 ; RUN: llvm-dwarfdump -debug-info %t/a.o %t/b.o | FileCheck %s
44
55 ; CHECK: dwo_id {{.*}}([[HASH:.*]])
66 ; CHECK-NOT: dwo_id {{.*}}([[HASH]])
None ; RUN: %llc_dwarf -split-dwarf-file=foo.dwo %s -filetype=obj -o - | llvm-dwarfdump -debug-dump=info - | FileCheck %s
0 ; RUN: %llc_dwarf -split-dwarf-file=foo.dwo %s -filetype=obj -o - | llvm-dwarfdump -debug-info - | FileCheck %s
11
22 ; Created from:
33 ; a.cpp:
0 ; RUN: llc -mtriple=x86_64-apple-darwin %s -o - -filetype=obj | \
1 ; RUN: llvm-dwarfdump --debug-dump=info - | FileCheck %s
1 ; RUN: llvm-dwarfdump --debug-info - | FileCheck %s
22 ;
33 ; Test emitting debug info for fragmented global values.
44 ; This is a handcrafted example of an SROAed global variable.
0 ; RUN: llc -split-dwarf-file=foo.dwo -O0 %s -mtriple=x86_64-unknown-linux-gnu -filetype=obj -o %t
1 ; RUN: llvm-dwarfdump -debug-dump=all %t | FileCheck %s --check-prefix=CHECK-DWO
1 ; RUN: llvm-dwarfdump -all %t | FileCheck %s --check-prefix=CHECK-DWO
22
33 ; Based on the debuginfo-tests/sret.cpp code.
44
None ; RUN: llc -filetype=obj -o - %s | llvm-dwarfdump -debug-dump=loc - | FileCheck %s
0 ; RUN: llc -filetype=obj -o - %s | llvm-dwarfdump -debug-loc - | FileCheck %s
11
22 ; Note that it would be even better to avoid emitting the empty piece.
33 ; CHECK: {{.*}}: DW_OP_piece 0x8{{$}}
None ; RUN: %llc_dwarf %s -filetype=obj -o - | llvm-dwarfdump -debug-dump=info - | FileCheck %s
0 ; RUN: %llc_dwarf %s -filetype=obj -o - | llvm-dwarfdump -debug-info - | FileCheck %s
11 ; Generated from:
22 ;
33 ; struct A {
0 ; RUN: llc -mtriple=x86_64-apple-darwin %s -o %t -filetype=obj
1 ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
1 ; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s
22
33 ; Make sure that structures have a decl file and decl line attached.
44 ; CHECK: DW_TAG_structure_type
0 ; RUN: llc -O0 %s -mtriple=x86_64-unknown-linux-gnu -filetype=obj -o %t
1 ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
1 ; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s
22
33 ; Make sure that the base type from the subrange type has a name.
44 ; CHECK: DW_TAG_subrange_type
0 ; REQUIRES: object-emission
11
2 ; RUN: llc -mtriple=x86_64-linux -O0 -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
2 ; RUN: llc -mtriple=x86_64-linux -O0 -filetype=obj < %s | llvm-dwarfdump -debug-info - | FileCheck %s
33
44 ; IR generated with `clang++ -g -emit-llvm -S` from the following code:
55 ; template class y, decltype(nullptr) n, int ...z> int func() { return 3; }
0 ; RUN: llc -filetype=asm -o - %s | FileCheck %s --check-prefix=ASM
1 ; RUN: llc -filetype=obj -o - %s | llvm-dwarfdump --debug-dump=info - | FileCheck %s
1 ; RUN: llc -filetype=obj -o - %s | llvm-dwarfdump --debug-info - | FileCheck %s
22 ;
33 ; Generated at -O2 from:
44 ; struct B;
None ; RUN: llc -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
0 ; RUN: llc -filetype=obj < %s | llvm-dwarfdump -debug-info - | FileCheck %s
11 ; CHECK: DW_TAG_variable
22 ; CHECK-NEXT: DW_AT_const_value [DW_FORM_udata] (0)
33 ; CHECK-NEXT: DW_AT_name {{.*}}"a"
0 ; RUN: llc -O0 -mtriple=x86_64-linux-gnu %s -o %t -filetype=obj
1 ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
1 ; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s
22
33 ; Verify that we've emitted template arguments for the union
44 ; CHECK: DW_TAG_union_type
0 ; RUN: llc -mtriple=x86_64-linux-gnu -O0 -filetype=obj -o %t %s
1 ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
1 ; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s
22
33 ; Generated from:
44 ; clang -g -S -emit-llvm -o foo.ll foo.c
None RUN: llvm-dwarfdump -debug-dump=macro %p/Inputs/dwarfdump-macro.o \
0 RUN: llvm-dwarfdump -debug-macro %p/Inputs/dwarfdump-macro.o \
11 RUN: | FileCheck %s -check-prefix TEST_MACINFO
2 RUN: llvm-dwarfdump -debug-dump=line %p/Inputs/dwarfdump-macro.o \
2 RUN: llvm-dwarfdump -debug-line %p/Inputs/dwarfdump-macro.o \
33 RUN: | FileCheck %s -check-prefix TEST_LINE
44
55
0 RUN: llvm-dwarfdump %p/Inputs/dwarfdump.elf-mips64-64-bit-dwarf \
1 RUN: --debug-dump=line | FileCheck %s
1 RUN: ---debug-line | FileCheck %s
22
33 # FIXME: llvm-dwarfdump's support for 64-bit dwarf is currently limited to
44 # .debug_line.
None ; RUN: llvm-dwarfdump %p/Inputs/dwarfdump-test-32bit.elf.o -debug-dump=frames | FileCheck %s -check-prefix FRAMES
0 ; RUN: llvm-dwarfdump %p/Inputs/dwarfdump-test-32bit.elf.o --debug-frames | FileCheck %s -check-prefix FRAMES
11 ; Note: the input file was generated from Inputs/dwarfdump-test-32bit.elf.c
22
33 ; FRAMES: .debug_frame
None ; RUN: llvm-dwarfdump %p/Inputs/dwarfdump-test.elf-x86-64 -debug-dump=all | FileCheck %s -check-prefix DUMP_ALL
1 ; RUN: llvm-dwarfdump %p/Inputs/dwarfdump-test.elf-x86-64 -debug-dump=info | FileCheck %s -check-prefix DUMP_INFO
2 ; RUN: llvm-dwarfdump %p/Inputs/dwarfdump-test.elf-x86-64 -debug-dump=ranges | FileCheck %s -check-prefix DUMP_RANGES
3 ; RUN: llvm-dwarfdump %p/Inputs/dwarfdump-test.macho-i386.o -debug-dump=all | FileCheck %s -check-prefix DUMP_ALL
4 ; RUN: llvm-dwarfdump %p/Inputs/dwarfdump-test.macho-i386.o -debug-dump=info | FileCheck %s -check-prefix DUMP_INFO
5 ; RUN: llvm-dwarfdump %p/Inputs/dwarfdump-test.macho-i386.o -debug-dump=ranges | FileCheck %s -check-prefix DUMP_RANGES
0 ; RUN: llvm-dwarfdump %p/Inputs/dwarfdump-test.elf-x86-64 --all | FileCheck %s -check-prefix DUMP_ALL
1 ; RUN: llvm-dwarfdump %p/Inputs/dwarfdump-test.elf-x86-64 --debug-info | FileCheck %s -check-prefix DUMP_INFO
2 ; RUN: llvm-dwarfdump %p/Inputs/dwarfdump-test.elf-x86-64 --debug-ranges | FileCheck %s -check-prefix DUMP_RANGES
3 ; RUN: llvm-dwarfdump %p/Inputs/dwarfdump-test.macho-i386.o -all | FileCheck %s -check-prefix DUMP_ALL
4 ; RUN: llvm-dwarfdump %p/Inputs/dwarfdump-test.macho-i386.o --debug-info | FileCheck %s -check-prefix DUMP_INFO
5 ; RUN: llvm-dwarfdump %p/Inputs/dwarfdump-test.macho-i386.o --debug-ranges | FileCheck %s -check-prefix DUMP_RANGES
66
77 ; DUMP_ALL: .debug_info
88 ; DUMP_ALL: .debug_ranges
None RUN: llvm-dwarfdump -debug-dump=gdb_index %p/Inputs/dwarfdump-gdbindex-v7.elf-x86-64 | FileCheck %s
0 RUN: llvm-dwarfdump -gdb-index %p/Inputs/dwarfdump-gdbindex-v7.elf-x86-64 | FileCheck %s
11
22 ; test.cpp:
33 ; int main() { return 0; }
None RUN: llvm-dwarfdump -debug-dump=abbrev %p/Inputs/implicit-const-test.o | FileCheck %s
0 RUN: llvm-dwarfdump -debug-abbrev %p/Inputs/implicit-const-test.o | FileCheck %s
11 CHECK: DW_FORM_implicit_const -9223372036854775808
None // RUN: llvm-dwarfdump -debug-dump=info %p/Inputs/dwarfdump-macho-relocs.macho.x86_64.o | FileCheck %s
0 // RUN: llvm-dwarfdump -debug-info %p/Inputs/dwarfdump-macho-relocs.macho.x86_64.o | FileCheck %s
11
22 // The dumped file has 2 functions in different sections of the __TEXT segment.
33 // Check that the addresses are are dumped correctly
0 Reuse a test input from llvm-dsymutil, it's perfect for what we want to exercise
1 RUN: llvm-dwarfdump %S/Inputs/fat-test.o -debug-dump=info | FileCheck %s
1 RUN: llvm-dwarfdump %S/Inputs/fat-test.o --debug-info | FileCheck %s
22
33 CHECK: fat-test.o (x86_64): file format Mach-O 64-bit x86-64
44 CHECK: DW_TAG_variable
0 RUN: llvm-dwarfdump %p/Inputs/dwarfdump-pubnames.elf-x86-64 \
1 RUN: -debug-dump=pubnames | FileCheck %s
1 RUN: --debug-pubnames | FileCheck %s
22
33 CHECK: .debug_pubnames contents:
44 CHECK: length = 0x000000a1 version = 0x0002 unit_offset = 0x00000000 unit_size = 0x00000141
0 RUN: llvm-dwarfdump %p/Inputs/dwarfdump-type-units.elf-x86-64 | FileCheck -check-prefix=CHECK -check-prefix=LONG %s
11 RUN: llvm-dwarfdump %p/Inputs/dwarfdump-type-units.elf-x86-64 -summarize-types | FileCheck -check-prefix=CHECK -check-prefix=SHORT %s
2 RUN: llvm-dwarfdump -debug-dump=types %p/Inputs/dwarfdump-type-units.elf-x86-64 | FileCheck -check-prefix=TYPES %s
2 RUN: llvm-dwarfdump -debug-types %p/Inputs/dwarfdump-type-units.elf-x86-64 | FileCheck -check-prefix=TYPES %s
33
44 CHECK: debug_info contents:
55
0 ; RUN: %llc_dwarf %s -filetype=obj -o %t
1 ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
1 ; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s
22 ; REQUIRES: default_triple
33 ;
44 ; CHECK: DW_TAG_compile_unit
0 ; RUN: %llc_dwarf %s -filetype=obj -o %t
1 ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
1 ; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s
22 ; CHECK: DW_TAG_compile_unit
33 ; CHECK: DW_AT_GNU_dwo_id {{.*}}abcd
44 ; CHECK: DW_AT_GNU_dwo_name {{.*}}"my.dwo"
8484 ; Crasher for llc.
8585 ; REQUIRES: object-emission
8686 ; RUN: %llc_dwarf -filetype=obj -O0 %t1 -o %t1.o
87 ; RUN: llvm-dwarfdump %t1.o -debug-dump=all | FileCheck %s -check-prefix=DWLW -check-prefix=DW
87 ; RUN: llvm-dwarfdump %t1.o --all | FileCheck %s -check-prefix=DWLW -check-prefix=DW
8888 ; RUN: %llc_dwarf -filetype=obj -O0 %t2 -o %t2.o
89 ; RUN: llvm-dwarfdump %t2.o -debug-dump=all | FileCheck %s -check-prefix=DWWL -check-prefix=DW
89 ; RUN: llvm-dwarfdump %t2.o --all | FileCheck %s -check-prefix=DWWL -check-prefix=DW
9090 ; Check that the debug info for the discarded linkonce version of @foo doesn't
9191 ; reference any code, and that the other subprograms look correct.
9292
11 ;
22 ; RUN: llvm-link %s %p/type-unique-odr-b.ll -S -o - \
33 ; RUN: | %llc_dwarf -dwarf-linkage-names=All -filetype=obj -O0 \
4 ; RUN: | llvm-dwarfdump -debug-dump=info - \
4 ; RUN: | llvm-dwarfdump -debug-info - \
55 ; RUN: | FileCheck %s
66 ; RUN: llvm-link %p/type-unique-odr-b.ll %s -S -o - \
77 ; RUN: | %llc_dwarf -dwarf-linkage-names=All -filetype=obj -O0 \
8 ; RUN: | llvm-dwarfdump -debug-dump=info - \
8 ; RUN: | llvm-dwarfdump -debug-info - \
99 ; RUN: | FileCheck %s
1010 ;
1111 ; Test ODR-based type uniquing for C++ class members.
22 ; RUN: llvm-link %s %p/type-unique-simple-b.ll -S -o %t
33 ; RUN: cat %t | FileCheck %s -check-prefix=LINK
44 ; RUN: %llc_dwarf -filetype=obj -O0 < %t > %t2
5 ; RUN: llvm-dwarfdump -debug-dump=info %t2 | FileCheck %s
5 ; RUN: llvm-dwarfdump -debug-info %t2 | FileCheck %s
66
77 ; Make sure the backend generates a single DIE and uses ref_addr.
88 ; CHECK: 0x[[BASE:.*]]: DW_TAG_structure_type
0 ; REQUIRES: default_triple, object-emission
11 ;
2 ; RUN: llvm-link %s %p/type-unique-simple2-b.ll -S -o - | %llc_dwarf -filetype=obj -O0 | llvm-dwarfdump -debug-dump=info - | FileCheck %s
2 ; RUN: llvm-link %s %p/type-unique-simple2-b.ll -S -o - | %llc_dwarf -filetype=obj -O0 | llvm-dwarfdump -debug-info - | FileCheck %s
33 ;
44 ; Tests for a merge error where attributes are inserted twice into the same DIE.
55 ;
33 ; RUN: llvm-link %S/Inputs/type-unique-simple2-a.ll %S/Inputs/type-unique-simple2-b.ll -S -o %t
44 ; RUN: cat %t | FileCheck %S/Inputs/type-unique-simple2-a.ll -check-prefix=LINK
55 ; RUN: %llc_dwarf -filetype=obj -O0 < %t > %t2
6 ; RUN: llvm-dwarfdump -debug-dump=info %t2 | FileCheck %S/Inputs/type-unique-simple2-a.ll
6 ; RUN: llvm-dwarfdump -debug-info %t2 | FileCheck %S/Inputs/type-unique-simple2-a.ll
0 ; REQUIRES: default_triple, object-emission
11 ;
2 ; RUN: llvm-link %s %p/type-unique-type-array-b.ll -S -o - | %llc_dwarf -filetype=obj -O0 | llvm-dwarfdump -debug-dump=info - | FileCheck %s
2 ; RUN: llvm-link %s %p/type-unique-type-array-b.ll -S -o - | %llc_dwarf -filetype=obj -O0 | llvm-dwarfdump -debug-info - | FileCheck %s
33 ;
44 ; rdar://problem/17628609
55 ;
0 // REQUIRES: shell
11 // RUN: llvm-mc -triple=x86_64-linux-unknown -g -fdebug-compilation-dir=/test/comp/dir %s -filetype=obj -o %t.o
2 // RUN: llvm-dwarfdump -debug-dump=info %t.o | FileCheck %s
2 // RUN: llvm-dwarfdump -debug-info %t.o | FileCheck %s
33
44 // CHECK: DW_AT_comp_dir [DW_FORM_string] ("{{([A-Za-z]:.*)?}}/test/comp/dir")
55
77 // RUN: ln -sf %t.foo %t.bar
88 // RUN: cd %t.foo
99 // RUN: env PWD=%t.bar llvm-mc -triple=x86_64-linux-unknown -g %s -filetype=obj -o %t.o
10 // RUN: llvm-dwarfdump -debug-dump=info %t.o | FileCheck --check-prefix=PWD %s
10 // RUN: llvm-dwarfdump -debug-info %t.o | FileCheck --check-prefix=PWD %s
1111 // PWD: DW_AT_comp_dir [DW_FORM_string] ("{{.*}}.bar")
1212
1313
0 // Check zlib-gnu style
11 // RUN: llvm-mc -filetype=obj -compress-debug-sections=zlib-gnu -triple x86_64-pc-linux-gnu < %s -o %t
22 // RUN: llvm-objdump -s %t | FileCheck --check-prefix=CHECK-GNU-STYLE %s
3 // RUN: llvm-dwarfdump -debug-dump=str %t | FileCheck --check-prefix=STR %s
3 // RUN: llvm-dwarfdump -debug-str %t | FileCheck --check-prefix=STR %s
44 // RUN: llvm-mc -filetype=obj -compress-debug-sections=zlib-gnu -triple i386-pc-linux-gnu < %s \
55 // RUN: | llvm-readobj -symbols - | FileCheck --check-prefix=386-SYMBOLS-GNU %s
66
77 // Check zlib style
88 // RUN: llvm-mc -filetype=obj -compress-debug-sections=zlib -triple x86_64-pc-linux-gnu < %s -o %t
99 // RUN: llvm-objdump -s %t | FileCheck --check-prefix=CHECK-ZLIB-STYLE %s
10 // RUN: llvm-dwarfdump -debug-dump=str %t | FileCheck --check-prefix=STR %s
10 // RUN: llvm-dwarfdump -debug-str %t | FileCheck --check-prefix=STR %s
1111 // RUN: llvm-mc -filetype=obj -compress-debug-sections=zlib -triple i386-pc-linux-gnu < %s \
1212 // RUN: | llvm-readobj -symbols - | FileCheck --check-prefix=386-SYMBOLS-ZLIB %s
1313 // RUN: llvm-readobj -sections %t | FileCheck --check-prefix=ZLIB-STYLE-FLAGS %s
0 # RUN: llvm-mc -triple i386-unknown-unknown %s -filetype=obj -o %t.o
11 # RUN: llvm-readobj -r %t.o | FileCheck %s
2 # RUN: llvm-dwarfdump -debug-dump=line %t.o | FileCheck %s -check-prefix=DWARF-DUMP
2 # RUN: llvm-dwarfdump -debug-line %t.o | FileCheck %s -check-prefix=DWARF-DUMP
33
44 .file 1 "foo.c"
55 .text
0 // RUN: llvm-mc -g -triple i386-apple-darwin10 %s -filetype=obj -o %t
1 // RUN: llvm-dwarfdump -debug-dump=line %t | FileCheck %s
1 // RUN: llvm-dwarfdump -debug-line %t | FileCheck %s
22
33 # 100 "t.s" 1
44 .globl _bar
0 // RUN: llvm-mc -g -triple i386-apple-darwin10 %s -filetype=obj -o %t
1 // RUN: llvm-dwarfdump -debug-dump=line %t | FileCheck %s
1 // RUN: llvm-dwarfdump -debug-line %t | FileCheck %s
22
33 # 1 "foo.S" 2
44 .macro switcher
0 // RUN: env DEBUG_PRODUCER="my producer" llvm-mc -g -triple i386-apple-darwin10 %s -filetype=obj -o %t
1 // RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
1 // RUN: llvm-dwarfdump -debug-info %t | FileCheck %s
22
33 .globl _bar
44 _bar:
0 // RUN: llvm-mc -g -triple i386-apple-darwin10 %s -filetype=obj -o %t
1 // RUN: llvm-dwarfdump -debug-dump=all %t | FileCheck %s
1 // RUN: llvm-dwarfdump -all %t | FileCheck %s
22
33 .globl _bar
44 _bar:
0 # RUN: llvm-mc -g -filetype=obj -triple x86_64-pc-linux-gnu %s -o %t.64
1 # RUN: llvm-dwarfdump -debug-dump=info %t.64 | FileCheck -check-prefix=DEFAULTABI %s
1 # RUN: llvm-dwarfdump -debug-info %t.64 | FileCheck -check-prefix=DEFAULTABI %s
22
33 # RUN: llvm-mc -g -filetype=obj -triple x86_64-pc-linux-gnux32 %s -o %t.32
4 # RUN: llvm-dwarfdump -debug-dump=info %t.32 | FileCheck -check-prefix=X32ABI %s
4 # RUN: llvm-dwarfdump -debug-info %t.32 | FileCheck -check-prefix=X32ABI %s
55
66 # This test checks the dwarf info section emitted to the output object by the
77 # assembler, looking at the difference between the x32 ABI and default x86-64
None ; RUN: llc -filetype=obj %s -o - | llvm-dwarfdump -debug-dump=frames - | FileCheck %s
0 ; RUN: llc -filetype=obj %s -o - | llvm-dwarfdump -debug-frames - | FileCheck %s
11
22 ; IR reduced from a dummy:
33 ; void foo() {}
None RUN: llvm-dwarfdump -debug-dump=info %p/../Inputs/elf-mip64-reloc.o 2>&1 | \
0 RUN: llvm-dwarfdump -debug-info %p/../Inputs/elf-mip64-reloc.o 2>&1 | \
11 RUN: FileCheck %s
22
33 CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000037] = "")
None RUN: llvm-dsymutil -y %p/dummy-debug-map.map -oso-prepend-path %p/../Inputs/scattered-reloc/ -f -o - | llvm-dwarfdump -debug-dump=info - | FileCheck %s
0 RUN: llvm-dsymutil -y %p/dummy-debug-map.map -oso-prepend-path %p/../Inputs/scattered-reloc/ -f -o - | llvm-dwarfdump -debug-info - | FileCheck %s
11
22 // See Inputs/scattered-reloc/scattered.s to see how this test
33 // actually works.
None RUN: llvm-dsymutil -oso-prepend-path %p/.. %p/../Inputs/common.macho.x86_64 -f -o - | llvm-dwarfdump -debug-dump=info - | FileCheck %s
0 RUN: llvm-dsymutil -oso-prepend-path %p/.. %p/../Inputs/common.macho.x86_64 -f -o - | llvm-dwarfdump -debug-info - | FileCheck %s
11
22 The test was compiled from a single source:
33 $ cat common.c
None # RUN: llvm-dsymutil -oso-prepend-path %p/../Inputs -y %s -f -o - | llvm-dwarfdump - -debug-dump=line | FileCheck %s
0 # RUN: llvm-dsymutil -oso-prepend-path %p/../Inputs -y %s -f -o - | llvm-dwarfdump - --debug-line | FileCheck %s
11
22 # This test runs dsymutil on an object file with non-standard (as far
33 # as llvm is concerned) line table settings.
None // RUN: llvm-dsymutil -f -y %p/dummy-debug-map.map -oso-prepend-path %p/../Inputs/dead-stripped -o - | llvm-dwarfdump - -debug-dump=info | FileCheck %s
0 // RUN: llvm-dsymutil -f -y %p/dummy-debug-map.map -oso-prepend-path %p/../Inputs/dead-stripped -o - | llvm-dwarfdump - --debug-info | FileCheck %s
11
22 // The test was compiled with:
33 // clang++ -O2 -g -c dead-strip.cpp -o 1.o
33 # Compile with:
44 # llvm-mc -triple x86_64-apple-darwin -filetype=obj -o 1.o empty_range.o
55
6 # RUN: llvm-dsymutil -f -y %p/dummy-debug-map.map -oso-prepend-path %p/../Inputs/empty_range -o - | llvm-dwarfdump -debug-dump=info - | FileCheck %s
6 # RUN: llvm-dsymutil -f -y %p/dummy-debug-map.map -oso-prepend-path %p/../Inputs/empty_range -o - | llvm-dwarfdump -debug-info - | FileCheck %s
77
88 .section __TEXT,__text,regular,pure_instructions
99 .macosx_version_min 10, 11
0 # REQUIRES: object-emission
1 # RUN: llvm-dsymutil -f -oso-prepend-path=%p/../Inputs -y %s -o - | llvm-dwarfdump -debug-dump=info - | FileCheck %s
1 # RUN: llvm-dsymutil -f -oso-prepend-path=%p/../Inputs -y %s -o - | llvm-dwarfdump -debug-info - | FileCheck %s
22
33 ---
44 triple: 'i386-apple-darwin'
0 # REQUIRES: object-emission
1 # RUN: llvm-dsymutil -f -oso-prepend-path=%p/../Inputs -y %s -o - | llvm-dwarfdump -debug-dump=info - | FileCheck %s
1 # RUN: llvm-dsymutil -f -oso-prepend-path=%p/../Inputs -y %s -o - | llvm-dwarfdump -debug-info - | FileCheck %s
22
33 ---
44 triple: 'x86_64-apple-darwin'
0 # REQUIRES: object-emission
1 # RUN: llvm-dsymutil -f -oso-prepend-path=%p/../Inputs -y %s -o - | llvm-dwarfdump -debug-dump=info - | FileCheck %s
1 # RUN: llvm-dsymutil -f -oso-prepend-path=%p/../Inputs -y %s -o - | llvm-dwarfdump -debug-info - | FileCheck %s
22
33 ---
44 triple: 'x86_64h-apple-darwin'
11 # RUN: rm -rf %t
22 # RUN: mkdir -p %t
33 # RUN: llc -filetype=obj %p/../Inputs/frame-dw2.ll -o %t/frame-dw2.o
4 # RUN: llvm-dsymutil -f -oso-prepend-path=%t -y %s -o - | llvm-dwarfdump -debug-dump=frames - | FileCheck %s
4 # RUN: llvm-dsymutil -f -oso-prepend-path=%t -y %s -o - | llvm-dwarfdump -debug-frames - | FileCheck %s
55
66 # This test is meant to verify that identical CIEs will get reused
77 # in the same file but also inbetween files. For this to happen, we
22 # RUN: mkdir -p %t
33 # RUN: llc -filetype=obj %p/../Inputs/frame-dw2.ll -o %t/frame-dw2.o
44 # RUN: llc -filetype=obj %p/../Inputs/frame-dw4.ll -o %t/frame-dw4.o
5 # RUN: llvm-dsymutil -f -oso-prepend-path=%t -y %s -o - | llvm-dwarfdump -debug-dump=frames - | FileCheck %s
5 # RUN: llvm-dsymutil -f -oso-prepend-path=%t -y %s -o - | llvm-dwarfdump -debug-frames - | FileCheck %s
66
77 # Check the handling of multiple different CIEs. To have CIEs that
88 # appear to be different, use a dwarf2 version of the file along with
99 // RUN: cp %p/../Inputs/modules-dwarf-version/1.o %t.dir
1010 // RUN: llvm-dsymutil -f -oso-prepend-path=%t.dir \
1111 // RUN: -y %p/dummy-debug-map.map -o - \
12 // RUN: | llvm-dwarfdump --debug-dump=info - | FileCheck %s
12 // RUN: | llvm-dwarfdump --debug-info - | FileCheck %s
1313
1414 @import Bar;
1515 int main(int argc, char **argv) {
1414 // RUN: cp %p/../Inputs/modules-empty/1.o %p/../Inputs/modules-empty/Empty.pcm %t.dir
1515 // RUN: llvm-dsymutil -f -oso-prepend-path=%t.dir \
1616 // RUN: -y %p/dummy-debug-map.map -o - \
17 // RUN: | llvm-dwarfdump --debug-dump=info - | FileCheck %s
17 // RUN: | llvm-dwarfdump --debug-info - | FileCheck %s
1818
1919 #include "Empty.h"
2020 int main() {
1919
2020 // RUN: llvm-dsymutil -f -oso-prepend-path=%p/../Inputs/modules \
2121 // RUN: -y %p/dummy-debug-map.map -o - \
22 // RUN: | llvm-dwarfdump --debug-dump=info - | FileCheck %s
22 // RUN: | llvm-dwarfdump --debug-info - | FileCheck %s
2323
2424 // RUN: llvm-dsymutil -f -oso-prepend-path=%p/../Inputs/modules -y \
2525 // RUN: %p/dummy-debug-map.map -o %t 2>&1 | FileCheck --check-prefix=WARN %s
33 done
44 */
55
6 // RUN: llvm-dsymutil -f -oso-prepend-path=%p/../Inputs/odr-anon-namespace -y %p/dummy-debug-map.map -o - | llvm-dwarfdump -debug-dump=info - | FileCheck %s
6 // RUN: llvm-dsymutil -f -oso-prepend-path=%p/../Inputs/odr-anon-namespace -y %p/dummy-debug-map.map -o - | llvm-dwarfdump -debug-info - | FileCheck %s
77
88 #ifdef FILE1
99 // Currently llvm-dsymutil will unique the contents of anonymous
33 done
44 */
55
6 // RUN: llvm-dsymutil -f -oso-prepend-path=%p/../Inputs/odr-fwd-declaration -y %p/dummy-debug-map.map -o - | llvm-dwarfdump -debug-dump=info - | FileCheck %s
6 // RUN: llvm-dsymutil -f -oso-prepend-path=%p/../Inputs/odr-fwd-declaration -y %p/dummy-debug-map.map -o - | llvm-dwarfdump -debug-info - | FileCheck %s
77
88 #ifdef FILE1
99 # 1 "Header.h" 1
33 done
44 */
55
6 // RUN: llvm-dsymutil -f -oso-prepend-path=%p/../Inputs/odr-fwd-declaration2 -y %p/dummy-debug-map.map -o - | llvm-dwarfdump -debug-dump=info - | FileCheck %s
6 // RUN: llvm-dsymutil -f -oso-prepend-path=%p/../Inputs/odr-fwd-declaration2 -y %p/dummy-debug-map.map -o - | llvm-dwarfdump -debug-info - | FileCheck %s
77
88 #ifdef FILE1
99 # 1 "Header.h" 1
33 done
44 */
55
6 // RUN: llvm-dsymutil -f -oso-prepend-path=%p/../Inputs/odr-member-functions -y %p/dummy-debug-map.map -o - | llvm-dwarfdump -debug-dump=info - | FileCheck %s
6 // RUN: llvm-dsymutil -f -oso-prepend-path=%p/../Inputs/odr-member-functions -y %p/dummy-debug-map.map -o - | llvm-dwarfdump -debug-info - | FileCheck %s
77
88 struct S {
99 __attribute__((always_inline)) void foo() { bar(); }
1010 - without ODR uniquing: all types are re-emited in the second CU
1111 */
1212
13 // RUN: llvm-dsymutil -f -oso-prepend-path=%p/../Inputs/odr-uniquing -y %p/dummy-debug-map.map -o - | llvm-dwarfdump -debug-dump=info - | FileCheck -check-prefix=ODR -check-prefix=CHECK %s
14 // RUN: llvm-dsymutil -f -oso-prepend-path=%p/../Inputs/odr-uniquing -y %p/dummy-debug-map.map -no-odr -o - | llvm-dwarfdump -debug-dump=info - | FileCheck -check-prefix=NOODR -check-prefix=CHECK %s
13 // RUN: llvm-dsymutil -f -oso-prepend-path=%p/../Inputs/odr-uniquing -y %p/dummy-debug-map.map -o - | llvm-dwarfdump -debug-info - | FileCheck -check-prefix=ODR -check-prefix=CHECK %s
14 // RUN: llvm-dsymutil -f -oso-prepend-path=%p/../Inputs/odr-uniquing -y %p/dummy-debug-map.map -no-odr -o - | llvm-dwarfdump -debug-info - | FileCheck -check-prefix=NOODR -check-prefix=CHECK %s
1515
1616 // The first compile unit contains all the types:
1717 // CHECK: TAG_compile_unit
1717
1818 // RUN: llvm-dsymutil -f -oso-prepend-path=%p/../Inputs/submodules \
1919 // RUN: -y %p/dummy-debug-map.map -o - \
20 // RUN: | llvm-dwarfdump --debug-dump=info - | FileCheck %s
20 // RUN: | llvm-dwarfdump --debug-info - | FileCheck %s
2121
2222 // ---------------------------------------------------------------------
2323 #ifdef CHILD_H
0 # RUN: llvm-mc %s -filetype obj -triple x86_64-apple-darwin -o - \
1 # RUN: | llvm-dwarfdump -debug-dump=info -brief - \
1 # RUN: | llvm-dwarfdump -debug-info --brief - \
22 # RUN: | FileCheck %s
33
44 # CHECK-NOT: .debug_abbrev contents:
0 # RUN: llvm-mc %S/brief.s -filetype obj -triple x86_64-apple-darwin -o - \
1 # RUN: | llvm-dwarfdump -debug-abbrev -debug-info - \
2 # RUN: | FileCheck %s
3
4 # CHECK-NOT: contents:
5 # CHECK: .debug_abbrev contents:
6 # CHECK-NOT: contents:
7 # CHECK: .debug_info contents:
8 # CHECK-NOT: contents:
3939 InputFilenames(cl::Positional, cl::desc(""),
4040 cl::ZeroOrMore);
4141
42 static cl::opt DumpType(
43 "debug-dump", cl::init(DIDT_Null), cl::desc("Dump of debug sections:"),
44 cl::values(
45 clEnumValN(DIDT_All, "all", "Dump all debug sections"),
46 clEnumValN(DIDT_Abbrev, "abbrev", ".debug_abbrev"),
47 clEnumValN(DIDT_AbbrevDwo, "abbrev.dwo", ".debug_abbrev.dwo"),
48 clEnumValN(DIDT_AppleNames, "apple_names", ".apple_names"),
49 clEnumValN(DIDT_AppleTypes, "apple_types", ".apple_types"),
50 clEnumValN(DIDT_AppleNamespaces, "apple_namespaces",
51 ".apple_namespaces"),
52 clEnumValN(DIDT_AppleObjC, "apple_objc", ".apple_objc"),
53 clEnumValN(DIDT_Aranges, "aranges", ".debug_aranges"),
54 clEnumValN(DIDT_Info, "info", ".debug_info"),
55 clEnumValN(DIDT_InfoDwo, "info.dwo", ".debug_info.dwo"),
56 clEnumValN(DIDT_Types, "types", ".debug_types"),
57 clEnumValN(DIDT_TypesDwo, "types.dwo", ".debug_types.dwo"),
58 clEnumValN(DIDT_Line, "line", ".debug_line"),
59 clEnumValN(DIDT_LineDwo, "line.dwo", ".debug_line.dwo"),
60 clEnumValN(DIDT_Loc, "loc", ".debug_loc"),
61 clEnumValN(DIDT_LocDwo, "loc.dwo", ".debug_loc.dwo"),
62 clEnumValN(DIDT_Frames, "frames", ".debug_frame"),
63 clEnumValN(DIDT_Macro, "macro", ".debug_macinfo"),
64 clEnumValN(DIDT_Ranges, "ranges", ".debug_ranges"),
65 clEnumValN(DIDT_Pubnames, "pubnames", ".debug_pubnames"),
66 clEnumValN(DIDT_Pubtypes, "pubtypes", ".debug_pubtypes"),
67 clEnumValN(DIDT_GnuPubnames, "gnu_pubnames", ".debug_gnu_pubnames"),
68 clEnumValN(DIDT_GnuPubtypes, "gnu_pubtypes", ".debug_gnu_pubtypes"),
69 clEnumValN(DIDT_Str, "str", ".debug_str"),
70 clEnumValN(DIDT_StrOffsets, "str_offsets", ".debug_str_offsets"),
71 clEnumValN(DIDT_StrDwo, "str.dwo", ".debug_str.dwo"),
72 clEnumValN(DIDT_StrOffsetsDwo, "str_offsets.dwo",
73 ".debug_str_offsets.dwo"),
74 clEnumValN(DIDT_CUIndex, "cu_index", ".debug_cu_index"),
75 clEnumValN(DIDT_GdbIndex, "gdb_index", ".gdb_index"),
76 clEnumValN(DIDT_TUIndex, "tu_index", ".debug_tu_index")));
42 static cl::opt DumpAll("all", cl::desc("Dump all debug info sections"));
43 static cl::alias DumpAllAlias("a", cl::desc("Alias for --all"),
44 cl::aliasopt(DumpAll));
45
46 static uint64_t DumpType = DIDT_Null;
47 #define HANDLE_DWARF_SECTION(ENUM_NAME, ELF_NAME, CMDLINE_NAME) \
48 static cl::opt Dump##ENUM_NAME( \
49 CMDLINE_NAME, cl::desc("Dump the " ELF_NAME " section"));
50 #include "llvm/BinaryFormat/Dwarf.def"
51 #undef HANDLE_DWARF_SECTION
7752
7853 static cl::opt
7954 SummarizeTypes("summarize-types",
8055 cl::desc("Abbreviate the description of type unit entries"));
81
8256 static cl::opt Verify("verify", cl::desc("Verify the DWARF debug info"));
83
8457 static cl::opt Quiet("quiet",
8558 cl::desc("Use with -verify to not emit to STDOUT."));
86
8759 static cl::opt Brief("brief", cl::desc("Print fewer low-level details"));
8860
8961 static void error(StringRef Filename, std::error_code EC) {
218190
219191 // Defaults to dumping all sections, unless brief mode is specified in which
220192 // case only the .debug_info section in dumped.
193 #define HANDLE_DWARF_SECTION(ENUM_NAME, ELF_NAME, CMDLINE_NAME) \
194 if (Dump##ENUM_NAME) \
195 DumpType |= DIDT_##ENUM_NAME;
196 #include "llvm/BinaryFormat/Dwarf.def"
197 #undef HANDLE_DWARF_SECTION
198 if (DumpAll)
199 DumpType = DIDT_All;
221200 if (DumpType == DIDT_Null) {
222201 if (Brief)
223 DumpType = DIDT_Info;
202 DumpType = DIDT_DebugInfo;
224203 else
225204 DumpType = DIDT_All;
226205 }
190190
191191 cl::opt llvm::DwarfDumpType(
192192 "dwarf", cl::init(DIDT_Null), cl::desc("Dump of dwarf debug sections:"),
193 cl::values(clEnumValN(DIDT_Frames, "frames", ".debug_frame")));
193 cl::values(clEnumValN(DIDT_DebugFrames, "frames", ".debug_frame")));
194194
195195 cl::opt PrintSource(
196196 "source",