llvm.org GIT mirror llvm / ab42578
Reland r200340 - 'Add line table debug info to COFF files when using a win32 triple' This incorporates a couple of fixes reviewed at http://llvm-reviews.chandlerc.com/D2651 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200440 91177308-0d34-0410-b5e6-96231b3b80d8 Timur Iskhodzhanov 6 years ago
40 changed file(s) with 1577 addition(s) and 59 deletion(s). Raw diff Collapse all Expand all
8888 void getScopeAndInlinedAt(MDNode *&Scope, MDNode *&IA,
8989 const LLVMContext &Ctx) const;
9090
91 /// getScopeNode - Get MDNode for DebugLoc's scope, or null if invalid.
92 MDNode *getScopeNode(const LLVMContext &Ctx) const;
93
94 // getFnDebugLoc - Walk up the scope chain of given debug loc and find line
95 // number info for the function.
96 DebugLoc getFnDebugLoc(const LLVMContext &Ctx);
9197
9298 /// getAsMDNode - This method converts the compressed DebugLoc node into a
9399 /// DILocation compatible MDNode.
4949 #include "llvm/Target/TargetRegisterInfo.h"
5050 #include "llvm/Target/TargetSubtargetInfo.h"
5151 #include "llvm/Transforms/Utils/GlobalStatus.h"
52 #include "WinCodeViewLineTables.h"
5253 using namespace llvm;
5354
5455 static const char *const DWARFGroupName = "DWARF Emission";
55 static const char *const DbgTimerName = "DWARF Debug Writer";
56 static const char *const DbgTimerName = "Debug Info Emission";
5657 static const char *const EHTimerName = "DWARF Exception Writer";
58 static const char *const CodeViewLineTablesGroupName = "CodeView Line Tables";
5759
5860 STATISTIC(EmittedInsts, "Number of machine instrs printed");
5961
201203 }
202204
203205 if (MAI->doesSupportDebugInformation()) {
204 DD = new DwarfDebug(this, &M);
205 Handlers.push_back(HandlerInfo(DD, DbgTimerName, DWARFGroupName));
206 if (Triple(TM.getTargetTriple()).getOS() == Triple::Win32) {
207 Handlers.push_back(HandlerInfo(new WinCodeViewLineTables(this),
208 DbgTimerName,
209 CodeViewLineTablesGroupName));
210 } else {
211 DD = new DwarfDebug(this, &M);
212 Handlers.push_back(HandlerInfo(DD, DbgTimerName, DWARFGroupName));
213 }
206214 }
207215
208216 DwarfException *DE = 0;
1212 ErlangGCPrinter.cpp
1313 OcamlGCPrinter.cpp
1414 Win64Exception.cpp
15 WinCodeViewLineTables.cpp
1516 )
1617
1718 add_dependencies(LLVMAsmPrinter intrinsics_gen)
15261526 }
15271527 }
15281528
1529 // Get MDNode for DebugLoc's scope.
1530 static MDNode *getScopeNode(DebugLoc DL, const LLVMContext &Ctx) {
1531 if (MDNode *InlinedAt = DL.getInlinedAt(Ctx))
1532 return getScopeNode(DebugLoc::getFromDILocation(InlinedAt), Ctx);
1533 return DL.getScope(Ctx);
1534 }
1535
1536 // Walk up the scope chain of given debug loc and find line number info
1537 // for the function.
1538 static DebugLoc getFnDebugLoc(DebugLoc DL, const LLVMContext &Ctx) {
1539 const MDNode *Scope = getScopeNode(DL, Ctx);
1540 DISubprogram SP = getDISubprogram(Scope);
1541 if (SP.isSubprogram()) {
1542 // Check for number of operands since the compatibility is
1543 // cheap here.
1544 if (SP->getNumOperands() > 19)
1545 return DebugLoc::get(SP.getScopeLineNumber(), 0, SP);
1546 else
1547 return DebugLoc::get(SP.getLineNumber(), 0, SP);
1548 }
1549
1550 return DebugLoc();
1551 }
1552
15531529 // Gather pre-function debug information. Assumes being called immediately
15541530 // after the function entry point has been emitted.
15551531 void DwarfDebug::beginFunction(const MachineFunction *MF) {
17441720 // Record beginning of function.
17451721 if (!PrologEndLoc.isUnknown()) {
17461722 DebugLoc FnStartDL =
1747 getFnDebugLoc(PrologEndLoc, MF->getFunction()->getContext());
1723 PrologEndLoc.getFnDebugLoc(MF->getFunction()->getContext());
17481724 recordSourceLine(
17491725 FnStartDL.getLine(), FnStartDL.getCol(),
17501726 FnStartDL.getScope(MF->getFunction()->getContext()),
0 //===-- llvm/lib/CodeGen/AsmPrinter/WinCodeViewLineTables.cpp --*- C++ -*--===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains support for writing line tables info into COFF files.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #include "WinCodeViewLineTables.h"
14 #include "llvm/MC/MCExpr.h"
15 #include "llvm/MC/MCSymbol.h"
16 #include "llvm/Support/COFF.h"
17
18 namespace llvm {
19
20 StringRef WinCodeViewLineTables::getFullFilepath(const MDNode *S) {
21 assert(S);
22 DIDescriptor D(S);
23 assert((D.isCompileUnit() || D.isFile() || D.isSubprogram() ||
24 D.isLexicalBlockFile() || D.isLexicalBlock()) &&
25 "Unexpected scope info");
26
27 DIScope Scope(S);
28 StringRef Dir = Scope.getDirectory(),
29 Filename = Scope.getFilename();
30 char *&Result = DirAndFilenameToFilepathMap[std::make_pair(Dir, Filename)];
31 if (Result != 0)
32 return Result;
33
34 // Clang emits directory and relative filename info into the IR, but CodeView
35 // operates on full paths. We could change Clang to emit full paths too, but
36 // that would increase the IR size and probably not needed for other users.
37 // For now, just concatenate and canonicalize the path here.
38 std::string Filepath;
39 if (Filename.find(':') == 1)
40 Filepath = Filename;
41 else
42 Filepath = (Dir + Twine("\\") + Filename).str();
43
44 // Canonicalize the path. We have to do it textually because we may no longer
45 // have access the file in the filesystem.
46 // First, replace all slashes with backslashes.
47 std::replace(Filepath.begin(), Filepath.end(), '/', '\\');
48
49 // Remove all "\.\" with "\".
50 size_t Cursor = 0;
51 while ((Cursor = Filepath.find("\\.\\", Cursor)) != std::string::npos)
52 Filepath.erase(Cursor, 2);
53
54 // Replace all "\XXX\..\" with "\". Don't try too hard though as the original
55 // path should be well-formatted, e.g. start with a drive letter, etc.
56 Cursor = 0;
57 while ((Cursor = Filepath.find("\\..\\", Cursor)) != std::string::npos) {
58 // Something's wrong if the path starts with "\..\", abort.
59 if (Cursor == 0)
60 break;
61
62 size_t PrevSlash = Filepath.rfind('\\', Cursor - 1);
63 if (PrevSlash == std::string::npos)
64 // Something's wrong, abort.
65 break;
66
67 Filepath.erase(PrevSlash, Cursor + 3 - PrevSlash);
68 // The next ".." might be following the one we've just erased.
69 Cursor = PrevSlash;
70 }
71
72 // Remove all duplicate backslashes.
73 Cursor = 0;
74 while ((Cursor = Filepath.find("\\\\", Cursor)) != std::string::npos)
75 Filepath.erase(Cursor, 1);
76
77 Result = strdup(Filepath.c_str());
78 return StringRef(Result);
79 }
80
81 void WinCodeViewLineTables::maybeRecordLocation(DebugLoc DL,
82 const MachineFunction *MF) {
83 const MDNode *Scope = DL.getScope(MF->getFunction()->getContext());
84 if (!Scope)
85 return;
86 StringRef Filename = getFullFilepath(Scope);
87
88 // Skip this instruction if it has the same file:line as the previous one.
89 assert(CurFn);
90 if (!CurFn->Instrs.empty()) {
91 const InstrInfoTy &LastInstr = InstrInfo[CurFn->Instrs.back()];
92 if (LastInstr.Filename == Filename && LastInstr.LineNumber == DL.getLine())
93 return;
94 }
95 FileNameRegistry.add(Filename);
96
97 MCSymbol *MCL = Asm->MMI->getContext().CreateTempSymbol();
98 Asm->OutStreamer.EmitLabel(MCL);
99 CurFn->Instrs.push_back(MCL);
100 InstrInfo[MCL] = InstrInfoTy(Filename, DL.getLine());
101 }
102
103 WinCodeViewLineTables::WinCodeViewLineTables(AsmPrinter *AP)
104 : Asm(0), CurFn(0) {
105 MachineModuleInfo *MMI = AP->MMI;
106
107 // If module doesn't have named metadata anchors or COFF debug section
108 // is not available, skip any debug info related stuff.
109 if (!MMI->getModule()->getNamedMetadata("llvm.dbg.cu") ||
110 !AP->getObjFileLowering().getCOFFDebugSymbolsSection())
111 return;
112
113 // Tell MMI that we have debug info.
114 MMI->setDebugInfoAvailability(true);
115 Asm = AP;
116 }
117
118 static void EmitLabelDiff(MCStreamer &Streamer,
119 const MCSymbol *From, const MCSymbol *To) {
120 MCSymbolRefExpr::VariantKind Variant = MCSymbolRefExpr::VK_None;
121 MCContext &Context = Streamer.getContext();
122 const MCExpr *FromRef = MCSymbolRefExpr::Create(From, Variant, Context),
123 *ToRef = MCSymbolRefExpr::Create(To, Variant, Context);
124 const MCExpr *AddrDelta =
125 MCBinaryExpr::Create(MCBinaryExpr::Sub, ToRef, FromRef, Context);
126 Streamer.EmitValue(AddrDelta, 4);
127 }
128
129 void WinCodeViewLineTables::emitDebugInfoForFunction(const Function *GV) {
130 // For each function there is a separate subsection
131 // which holds the PC to file:line table.
132 const MCSymbol *Fn = Asm->getSymbol(GV);
133 const FunctionInfo &FI = FnDebugInfo[GV];
134 assert(Fn);
135 assert(FI.Instrs.size() > 0);
136
137 // PCs/Instructions are grouped into segments sharing the same filename.
138 // Pre-calculate the lengths (in instructions) of these segments and store
139 // them in a map for convenience. Each index in the map is the sequential
140 // number of the respective instruction that starts a new segment.
141 DenseMap FilenameSegmentLengths;
142 size_t LastSegmentEnd = 0;
143 StringRef PrevFilename = InstrInfo[FI.Instrs[0]].Filename;
144 for (size_t J = 1, F = FI.Instrs.size(); J != F; ++J) {
145 if (PrevFilename == InstrInfo[FI.Instrs[J]].Filename)
146 continue;
147 FilenameSegmentLengths[LastSegmentEnd] = J - LastSegmentEnd;
148 LastSegmentEnd = J;
149 PrevFilename = InstrInfo[FI.Instrs[J]].Filename;
150 }
151 FilenameSegmentLengths[LastSegmentEnd] = FI.Instrs.size() - LastSegmentEnd;
152
153 // Emit the control code of the subsection followed by the payload size.
154 Asm->OutStreamer.AddComment(
155 "Linetable subsection for " + Twine(Fn->getName()));
156 Asm->EmitInt32(COFF::DEBUG_LINE_TABLE_SUBSECTION);
157 MCSymbol *SubsectionBegin = Asm->MMI->getContext().CreateTempSymbol(),
158 *SubsectionEnd = Asm->MMI->getContext().CreateTempSymbol();
159 EmitLabelDiff(Asm->OutStreamer, SubsectionBegin, SubsectionEnd);
160 Asm->OutStreamer.EmitLabel(SubsectionBegin);
161
162 // Identify the function this subsection is for.
163 Asm->OutStreamer.EmitCOFFSecRel32(Fn);
164 Asm->OutStreamer.EmitCOFFSectionIndex(Fn);
165
166 // Length of the function's code, in bytes.
167 EmitLabelDiff(Asm->OutStreamer, Fn, FI.End);
168
169 // PC-to-linenumber lookup table:
170 MCSymbol *FileSegmentEnd = 0;
171 for (size_t J = 0, F = FI.Instrs.size(); J != F; ++J) {
172 MCSymbol *Instr = FI.Instrs[J];
173 assert(InstrInfo.count(Instr));
174
175 if (FilenameSegmentLengths.count(J)) {
176 // We came to a beginning of a new filename segment.
177 if (FileSegmentEnd)
178 Asm->OutStreamer.EmitLabel(FileSegmentEnd);
179 StringRef CurFilename = InstrInfo[FI.Instrs[J]].Filename;
180 assert(FileNameRegistry.Infos.count(CurFilename));
181 size_t IndexInStringTable =
182 FileNameRegistry.Infos[CurFilename].FilenameID;
183 // Each segment starts with the offset of the filename
184 // in the string table.
185 Asm->OutStreamer.AddComment(
186 "Segment for file '" + Twine(CurFilename) + "' begins");
187 MCSymbol *FileSegmentBegin = Asm->MMI->getContext().CreateTempSymbol();
188 Asm->OutStreamer.EmitLabel(FileSegmentBegin);
189 Asm->EmitInt32(8 * IndexInStringTable);
190
191 // Number of PC records in the lookup table.
192 size_t SegmentLength = FilenameSegmentLengths[J];
193 Asm->EmitInt32(SegmentLength);
194
195 // Full size of the segment for this filename, including the prev two
196 // records.
197 FileSegmentEnd = Asm->MMI->getContext().CreateTempSymbol();
198 EmitLabelDiff(Asm->OutStreamer, FileSegmentBegin, FileSegmentEnd);
199 }
200
201 // The first PC with the given linenumber and the linenumber itself.
202 EmitLabelDiff(Asm->OutStreamer, Fn, Instr);
203 Asm->EmitInt32(InstrInfo[Instr].LineNumber);
204 }
205
206 if (FileSegmentEnd)
207 Asm->OutStreamer.EmitLabel(FileSegmentEnd);
208 Asm->OutStreamer.EmitLabel(SubsectionEnd);
209 }
210
211 void WinCodeViewLineTables::endModule() {
212 if (FnDebugInfo.empty())
213 return;
214
215 assert(Asm != 0);
216 Asm->OutStreamer.SwitchSection(
217 Asm->getObjFileLowering().getCOFFDebugSymbolsSection());
218 Asm->EmitInt32(COFF::DEBUG_SECTION_MAGIC);
219
220 // The COFF .debug$S section consists of several subsections, each starting
221 // with a 4-byte control code (e.g. 0xF1, 0xF2, etc) and then a 4-byte length
222 // of the payload followed by the payload itself. The subsections are 4-byte
223 // aligned.
224
225 for (size_t I = 0, E = VisitedFunctions.size(); I != E; ++I)
226 emitDebugInfoForFunction(VisitedFunctions[I]);
227
228 // This subsection holds a file index to offset in string table table.
229 Asm->OutStreamer.AddComment("File index to string table offset subsection");
230 Asm->EmitInt32(COFF::DEBUG_INDEX_SUBSECTION);
231 size_t NumFilenames = FileNameRegistry.Infos.size();
232 Asm->EmitInt32(8 * NumFilenames);
233 for (size_t I = 0, E = FileNameRegistry.Filenames.size(); I != E; ++I) {
234 StringRef Filename = FileNameRegistry.Filenames[I];
235 // For each unique filename, just write it's offset in the string table.
236 Asm->EmitInt32(FileNameRegistry.Infos[Filename].StartOffset);
237 // The function name offset is not followed by any additional data.
238 Asm->EmitInt32(0);
239 }
240
241 // This subsection holds the string table.
242 Asm->OutStreamer.AddComment("String table");
243 Asm->EmitInt32(COFF::DEBUG_STRING_TABLE_SUBSECTION);
244 Asm->EmitInt32(FileNameRegistry.LastOffset);
245 // The payload starts with a null character.
246 Asm->EmitInt8(0);
247
248 for (size_t I = 0, E = FileNameRegistry.Filenames.size(); I != E; ++I) {
249 // Just emit unique filenames one by one, separated by a null character.
250 Asm->OutStreamer.EmitBytes(FileNameRegistry.Filenames[I]);
251 Asm->EmitInt8(0);
252 }
253
254 // No more subsections. Fill with zeros to align the end of the section by 4.
255 Asm->OutStreamer.EmitFill((-FileNameRegistry.LastOffset) % 4, 0);
256
257 clear();
258 }
259
260 void WinCodeViewLineTables::beginFunction(const MachineFunction *MF) {
261 assert(!CurFn && "Can't process two functions at once!");
262
263 if (!Asm || !Asm->MMI->hasDebugInfo())
264 return;
265
266 // Grab the lexical scopes for the function, if we don't have any of those
267 // then we're not going to be able to do anything.
268 LScopes.initialize(*MF);
269 if (LScopes.empty())
270 return;
271
272 const Function *GV = MF->getFunction();
273 assert(FnDebugInfo.count(GV) == false);
274 VisitedFunctions.push_back(GV);
275 CurFn = &FnDebugInfo[GV];
276
277 // Find the end of the function prolog.
278 // FIXME: is there a simpler a way to do this? Can we just search
279 // for the first instruction of the function, not the last of the prolog?
280 DebugLoc PrologEndLoc;
281 bool EmptyPrologue = true;
282 for (MachineFunction::const_iterator I = MF->begin(), E = MF->end();
283 I != E && PrologEndLoc.isUnknown(); ++I) {
284 for (MachineBasicBlock::const_iterator II = I->begin(), IE = I->end();
285 II != IE; ++II) {
286 const MachineInstr *MI = II;
287 if (MI->isDebugValue())
288 continue;
289
290 // First known non-DBG_VALUE and non-frame setup location marks
291 // the beginning of the function body.
292 // FIXME: do we need the first subcondition?
293 if (!MI->getFlag(MachineInstr::FrameSetup) &&
294 (!MI->getDebugLoc().isUnknown())) {
295 PrologEndLoc = MI->getDebugLoc();
296 break;
297 }
298 EmptyPrologue = false;
299 }
300 }
301 // Record beginning of function if we have a non-empty prologue.
302 if (!PrologEndLoc.isUnknown() && !EmptyPrologue) {
303 DebugLoc FnStartDL =
304 PrologEndLoc.getFnDebugLoc(MF->getFunction()->getContext());
305 maybeRecordLocation(FnStartDL, MF);
306 }
307 }
308
309 void WinCodeViewLineTables::endFunction(const MachineFunction *) {
310 if (!Asm || !CurFn) // We haven't created any debug info for this function.
311 return;
312
313 if (CurFn->Instrs.empty())
314 llvm_unreachable("Can this ever happen?");
315
316 // Define end label for subprogram.
317 MCSymbol *FunctionEndSym = Asm->OutStreamer.getContext().CreateTempSymbol();
318 Asm->OutStreamer.EmitLabel(FunctionEndSym);
319 CurFn->End = FunctionEndSym;
320 CurFn = 0;
321 }
322
323 void WinCodeViewLineTables::beginInstruction(const MachineInstr *MI) {
324 // Ignore DBG_VALUE locations and function prologue.
325 if (!Asm || MI->isDebugValue() || MI->getFlag(MachineInstr::FrameSetup))
326 return;
327 DebugLoc DL = MI->getDebugLoc();
328 if (DL == PrevInstLoc || DL.isUnknown())
329 return;
330 maybeRecordLocation(DL, Asm->MF);
331 }
332 }
0 //===-- llvm/lib/CodeGen/AsmPrinter/WinCodeViewLineTables.h ----*- C++ -*--===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains support for writing line tables info into COFF files.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #ifndef CODEGEN_ASMPRINTER_WINCODEVIEWLINETABLES_H__
14 #define CODEGEN_ASMPRINTER_WINCODEVIEWLINETABLES_H__
15
16 #include "AsmPrinterHandler.h"
17 #include "llvm/ADT/DenseMap.h"
18 #include "llvm/ADT/StringMap.h"
19 #include "llvm/ADT/StringRef.h"
20 #include "llvm/DebugInfo.h"
21 #include "llvm/CodeGen/AsmPrinter.h"
22 #include "llvm/CodeGen/MachineFunction.h"
23 #include "llvm/CodeGen/MachineModuleInfo.h"
24 #include "llvm/CodeGen/LexicalScopes.h"
25 #include "llvm/MC/MCStreamer.h"
26 #include "llvm/Support/DebugLoc.h"
27 #include "llvm/Target/TargetLoweringObjectFile.h"
28
29 namespace llvm {
30 /// \brief Collects and handles line tables information in a CodeView format.
31 class WinCodeViewLineTables : public AsmPrinterHandler {
32 AsmPrinter *Asm;
33 DebugLoc PrevInstLoc;
34 LexicalScopes LScopes;
35
36 // For each function, store a vector of labels to its instructions, as well as
37 // to the end of the function.
38 struct FunctionInfo {
39 SmallVector Instrs;
40 MCSymbol *End;
41 } *CurFn;
42
43 typedef DenseMap FnDebugInfoTy;
44 FnDebugInfoTy FnDebugInfo;
45 // Store the functions we've visited in a vector so we can maintain a stable
46 // order while emitting subsections.
47 SmallVector VisitedFunctions;
48
49 // InstrInfoTy - Holds the Filename:LineNumber information for every
50 // instruction with a unique debug location.
51 struct InstrInfoTy {
52 StringRef Filename;
53 unsigned LineNumber;
54
55 InstrInfoTy() : LineNumber(0) {}
56
57 InstrInfoTy(StringRef Filename, unsigned LineNumber)
58 : Filename(Filename), LineNumber(LineNumber) {}
59 };
60 DenseMap InstrInfo;
61
62 // FileNameRegistry - Manages filenames observed while generating debug info
63 // by filtering out duplicates and bookkeeping the offsets in the string
64 // table to be generated.
65 struct FileNameRegistryTy {
66 SmallVector Filenames;
67 struct PerFileInfo {
68 size_t FilenameID, StartOffset;
69 };
70 StringMap Infos;
71
72 // The offset in the string table where we'll write the next unique
73 // filename.
74 size_t LastOffset;
75
76 FileNameRegistryTy() {
77 clear();
78 }
79
80 // Add Filename to the registry, if it was not observed before.
81 void add(StringRef Filename) {
82 if (Infos.count(Filename))
83 return;
84 size_t OldSize = Infos.size();
85 Infos[Filename].FilenameID = OldSize;
86 Infos[Filename].StartOffset = LastOffset;
87 LastOffset += Filename.size() + 1;
88 Filenames.push_back(Filename);
89 }
90
91 void clear() {
92 LastOffset = 1;
93 Infos.clear();
94 Filenames.clear();
95 }
96 } FileNameRegistry;
97
98 typedef std::map, char *>
99 DirAndFilenameToFilepathMapTy;
100 DirAndFilenameToFilepathMapTy DirAndFilenameToFilepathMap;
101 StringRef getFullFilepath(const MDNode *S);
102
103 void maybeRecordLocation(DebugLoc DL, const MachineFunction *MF);
104
105 void clear() {
106 assert(CurFn == 0);
107 FileNameRegistry.clear();
108 InstrInfo.clear();
109 }
110
111 void emitDebugInfoForFunction(const Function *GV);
112
113 public:
114 WinCodeViewLineTables(AsmPrinter *Asm);
115
116 ~WinCodeViewLineTables() {
117 for (DirAndFilenameToFilepathMapTy::iterator
118 I = DirAndFilenameToFilepathMap.begin(),
119 E = DirAndFilenameToFilepathMap.end();
120 I != E; ++I)
121 free(I->second);
122 }
123
124 virtual void setSymbolSize(const llvm::MCSymbol *, uint64_t) {}
125
126 /// \brief Emit the COFF section that holds the line table information.
127 virtual void endModule();
128
129 /// \brief Gather pre-function debug information.
130 virtual void beginFunction(const MachineFunction *MF);
131
132 /// \brief Gather post-function debug information.
133 virtual void endFunction(const MachineFunction *);
134
135 /// \brief Process beginning of an instruction.
136 virtual void beginInstruction(const MachineInstr *MI);
137
138 /// \brief Process end of an instruction.
139 virtual void endInstruction() {}
140 };
141 } // End of namespace llvm
142
143 #endif
6969 IA = Ctx.pImpl->ScopeInlinedAtRecords[-ScopeIdx-1].second.get();
7070 }
7171
72 MDNode *DebugLoc::getScopeNode(const LLVMContext &Ctx) const {
73 if (MDNode *InlinedAt = getInlinedAt(Ctx))
74 return DebugLoc::getFromDILocation(InlinedAt).getScopeNode(Ctx);
75 return getScope(Ctx);
76 }
77
78 DebugLoc DebugLoc::getFnDebugLoc(const LLVMContext &Ctx) {
79 const MDNode *Scope = getScopeNode(Ctx);
80 DISubprogram SP = getDISubprogram(Scope);
81 if (SP.isSubprogram()) {
82 // Check for number of operands since the compatibility is
83 // cheap here. FIXME: Name the magic constant.
84 if (SP->getNumOperands() > 19)
85 return DebugLoc::get(SP.getScopeLineNumber(), 0, SP);
86 else
87 return DebugLoc::get(SP.getLineNumber(), 0, SP);
88 }
89
90 return DebugLoc();
91 }
7292
7393 DebugLoc DebugLoc::get(unsigned Line, unsigned Col,
7494 MDNode *Scope, MDNode *InlinedAt) {
148148 // Exception Handling.
149149 LSDASection = Ctx->getMachOSection("__TEXT", "__gcc_except_tab", 0,
150150 SectionKind::getReadOnlyWithRel());
151
152 COFFDebugSymbolsSection = 0;
151153
152154 if (T.isMacOSX() && !T.isMacOSXVersionLT(10, 6)) {
153155 CompactUnwindSection =
457459 ELF::SHF_ALLOC,
458460 SectionKind::getReadOnly());
459461
462 COFFDebugSymbolsSection = 0;
463
460464 // Debug Info Sections.
461465 DwarfAbbrevSection =
462466 Ctx->getELFSection(".debug_abbrev", ELF::SHT_PROGBITS, 0,
None ; RUN: llc -O0 < %s | grep AT_decl_file | grep 2
0 ; RUN: %llc_dwarf -O0 < %s | grep AT_decl_file | grep 2
11 ; Here _ZN1S3fooEv is defined in header file identified as AT_decl_file no. 2 in debug info.
22 %struct.S = type <{ i8 }>
33
None ; RUN: llvm-as < %s | llc -asm-verbose -O0 | grep AT_specification | count 2
0 ; RUN: llvm-as < %s | %llc_dwarf -asm-verbose -O0 | grep AT_specification | count 2
11 ; Radar 7833483
22 ; Do not emit AT_specification for nested function foo.
33
None ; RUN: llc -asm-verbose -O1 -o %t < %s
0 ; RUN: %llc_dwarf -asm-verbose -O1 -o %t < %s
11 ; RUN: grep DW_AT_APPLE_omit_frame_ptr %t
2 ; RUN: llc -disable-fp-elim -asm-verbose -O1 -o %t < %s
2 ; RUN: %llc_dwarf -disable-fp-elim -asm-verbose -O1 -o %t < %s
33 ; RUN: grep -v DW_AT_APPLE_omit_frame_ptr %t
44
55
0 ; REQUIRES: object-emission
11
2 ; RUN: llc -O0 -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
2 ; RUN: %llc_dwarf -O0 -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
33
44 ; Check that two compile units are generated
55
None ; RUN: llc -O2 %s -o - | FileCheck %s
0 ; RUN: %llc_dwarf -O2 %s -o - | FileCheck %s
11 ; Check struct X for dead variable xyz from inlined function foo.
22
33 ; CHECK: DW_TAG_structure_type
0 ; RUN: llc -mtriple=i686-pc-win32 -O0 < %s | FileCheck --check-prefix=X86 %s
1 ; RUN: llc -mtriple=i686-pc-win32 -o - -O0 < %s | llvm-mc -triple=i686-pc-win32 -filetype=obj | llvm-readobj -s -sr -codeview-linetables | FileCheck --check-prefix=OBJ32 %s
2 ; RUN: llc -mtriple=x86_64-pc-win32 -O0 < %s | FileCheck --check-prefix=X64 %s
3 ; RUN: llc -mtriple=x86_64-pc-win32 -o - -O0 < %s | llvm-mc -triple=x86_64-pc-win32 -filetype=obj | llvm-readobj -s -sr -codeview-linetables | FileCheck --check-prefix=OBJ64 %s
4
5 ; This LL file was generated by running clang on the following code:
6 ; D:\asm.c:
7 ; 1 void g(void);
8 ; 2
9 ; 3 void f(void) {
10 ; 4 __asm align 4;
11 ; 5 g();
12 ; 6 }
13
14 ; X86: _f:
15 ; X86-NEXT: # BB
16 ; X86-NEXT: [[ASM_LINE:^L.*]]:{{$}}
17 ; X86: [[CALL_LINE:^L.*]]:{{$}}
18 ; X86-NEXT: calll _g
19 ; X86-NEXT: [[RETURN_STMT:.*]]:
20 ; X86-NEXT: ret
21 ; X86-NEXT: [[END_OF_F:.*]]:
22 ;
23 ; X86: .section .debug$S,"rn"
24 ; X86-NEXT: .long 4
25 ; X86-NEXT: .long 242
26 ; X86-NEXT: .long [[F2_END:.*]]-[[F2_START:.*]]
27 ; X86-NEXT: [[F2_START]]:
28 ; X86-NEXT: .secrel32 _f
29 ; X86-NEXT: .secidx _f
30 ; X86-NEXT: .long [[END_OF_F]]-_f
31 ; X86-NEXT: [[FILE_SEGMENT_START:[^:]*]]:
32 ; X86-NEXT: .long 0
33 ; X86-NEXT: .long 3
34 ; X86-NEXT: .long [[FILE_SEGMENT_END:.*]]-[[FILE_SEGMENT_START]]
35 ; X86-NEXT: .long [[ASM_LINE]]-_f
36 ; X86-NEXT: .long 4
37 ; X86-NEXT: .long [[CALL_LINE]]-_f
38 ; X86-NEXT: .long 5
39 ; X86-NEXT: .long [[RETURN_STMT]]-_f
40 ; X86-NEXT: .long 6
41 ; X86-NEXT: [[FILE_SEGMENT_END]]:
42 ; X86-NEXT: [[F2_END]]:
43 ; File index to string table offset subsection
44 ; X86-NEXT: .long 244
45 ; X86-NEXT: .long 8
46 ; X86-NEXT: .long 1
47 ; X86-NEXT: .long 0
48 ; String table
49 ; X86-NEXT: .long 243
50 ; X86-NEXT: .long 10
51 ; X86-NEXT: .byte 0
52 ; X86-NEXT: .ascii "D:\\asm.c"
53 ; X86-NEXT: .byte 0
54 ; Padding
55 ; X86-NEXT: .zero 2
56
57 ; OBJ32: Section {
58 ; OBJ32: Name: .debug$S (2E 64 65 62 75 67 24 53)
59 ; OBJ32: Characteristics [ (0x42100040)
60 ; OBJ32: ]
61 ; OBJ32: Relocations [
62 ; OBJ32-NEXT: 0xC IMAGE_REL_I386_SECREL _f
63 ; OBJ32-NEXT: 0x10 IMAGE_REL_I386_SECTION _f
64 ; OBJ32-NEXT: ]
65 ; OBJ32: FunctionLineTable [
66 ; OBJ32-NEXT: Name: _f
67 ; OBJ32-NEXT: CodeSize: 0x6
68 ; OBJ32-NEXT: FilenameSegment [
69 ; OBJ32-NEXT: Filename: D:\asm.c
70 ; FIXME: An empty __asm stmt creates an extra entry.
71 ; We seem to know that these offsets are the same statically during the
72 ; execution of endModule().
73 ; OBJ32-NEXT: +0x0: 4
74 ; OBJ32-NEXT: +0x0: 5
75 ; OBJ32-NEXT: +0x5: 6
76 ; OBJ32-NEXT: ]
77 ; OBJ32-NEXT: ]
78 ; OBJ32: }
79
80 ; X64: f:
81 ; X64-NEXT: [[START:.*]]:{{$}}
82 ; X64-NEXT: # BB
83 ; X64-NEXT: subq $40, %rsp
84 ; X64-NEXT: [[ASM_LINE:.*]]:{{$}}
85 ; X64: [[CALL_LINE:.*]]:{{$}}
86 ; X64-NEXT: callq g
87 ; X64-NEXT: [[EPILOG_AND_RET:.*]]:
88 ; X64-NEXT: addq $40, %rsp
89 ; X64-NEXT: ret
90 ; X64-NEXT: [[END_OF_F:.*]]:
91 ;
92 ; X64: .section .debug$S,"rn"
93 ; X64-NEXT: .long 4
94 ; X64-NEXT: .long 242
95 ; X64-NEXT: .long [[F2_END:.*]]-[[F2_START:.*]]
96 ; X64-NEXT: [[F2_START]]:
97 ; X64-NEXT: .secrel32 f
98 ; X64-NEXT: .secidx f
99 ; X64-NEXT: .long [[END_OF_F]]-f
100 ; X64-NEXT: [[FILE_SEGMENT_START:[^:]*]]:
101 ; X64-NEXT: .long 0
102 ; X64-NEXT: .long 4
103 ; X64-NEXT: .long [[FILE_SEGMENT_END:.*]]-[[FILE_SEGMENT_START]]
104 ; X64-NEXT: .long [[START]]-f
105 ; X64-NEXT: .long 3
106 ; X64-NEXT: .long [[ASM_LINE]]-f
107 ; X64-NEXT: .long 4
108 ; X64-NEXT: .long [[CALL_LINE]]-f
109 ; X64-NEXT: .long 5
110 ; X64-NEXT: .long [[EPILOG_AND_RET]]-f
111 ; X64-NEXT: .long 6
112 ; X64-NEXT: [[FILE_SEGMENT_END]]:
113 ; X64-NEXT: [[F2_END]]:
114 ; File index to string table offset subsection
115 ; X64-NEXT: .long 244
116 ; X64-NEXT: .long 8
117 ; X64-NEXT: .long 1
118 ; X64-NEXT: .long 0
119 ; String table
120 ; X64-NEXT: .long 243
121 ; X64-NEXT: .long 10
122 ; X64-NEXT: .byte 0
123 ; X64-NEXT: .ascii "D:\\asm.c"
124 ; X64-NEXT: .byte 0
125 ; Padding
126 ; X64-NEXT: .zero 2
127
128 ; OBJ64: Section {
129 ; OBJ64: Name: .debug$S (2E 64 65 62 75 67 24 53)
130 ; OBJ64: Characteristics [ (0x42100040)
131 ; OBJ64: ]
132 ; OBJ64: Relocations [
133 ; OBJ64-NEXT: 0xC IMAGE_REL_AMD64_SECREL f
134 ; OBJ64-NEXT: 0x10 IMAGE_REL_AMD64_SECTION f
135 ; OBJ64-NEXT: ]
136 ; OBJ64: FunctionLineTable [
137 ; OBJ64-NEXT: Name: f
138 ; OBJ64-NEXT: CodeSize: 0xE
139 ; OBJ64-NEXT: FilenameSegment [
140 ; OBJ64-NEXT: Filename: D:\asm.c
141 ; OBJ64-NEXT: +0x0: 3
142 ; FIXME: An empty __asm stmt creates an extra entry.
143 ; OBJ64-NEXT: +0x4: 4
144 ; OBJ64-NEXT: +0x4: 5
145 ; OBJ64-NEXT: +0x9: 6
146 ; OBJ64-NEXT: ]
147 ; OBJ64-NEXT: ]
148 ; OBJ64: }
149
150 ; Function Attrs: nounwind
151 define void @f() #0 {
152 entry:
153 call void asm sideeffect inteldialect ".align 4", "~{dirflag},~{fpsr},~{flags}"() #2, !dbg !12
154 call void @g(), !dbg !13
155 ret void, !dbg !14
156 }
157
158 declare void @g() #1
159
160 attributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-realign-stack" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
161 attributes #1 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-realign-stack" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
162 attributes #2 = { nounwind }
163
164 !llvm.dbg.cu = !{!0}
165 !llvm.module.flags = !{!9, !10}
166 !llvm.ident = !{!11}
167
168 !0 = metadata !{i32 786449, metadata !1, i32 12, metadata !"clang version 3.5 ", i1 false, metadata !"", i32 0, metadata !2, metadata !2, metadata !3, metadata !2, metadata !2, metadata !""} ; [ DW_TAG_compile_unit ] [D:\/] [DW_LANG_C99]
169 !1 = metadata !{metadata !"", metadata !"D:\5C"}
170 !2 = metadata !{i32 0}
171 !3 = metadata !{metadata !4}
172 !4 = metadata !{i32 786478, metadata !5, metadata !6, metadata !"f", metadata !"f", metadata !"", i32 3, metadata !7, i1 false, i1 true, i32 0, i32 0, null, i32 256, i1 false, void ()* @f, null, null, metadata !2, i32 3} ; [ DW_TAG_subprogram ] [line 3] [def] [f]
173 !5 = metadata !{metadata !"asm.c", metadata !"D:\5C"}
174 !6 = metadata !{i32 786473, metadata !5} ; [ DW_TAG_file_type ] [D:\/asm.c]
175 !7 = metadata !{i32 786453, i32 0, null, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !8, i32 0, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
176 !8 = metadata !{null}
177 !9 = metadata !{i32 2, metadata !"Dwarf Version", i32 4}
178 !10 = metadata !{i32 1, metadata !"Debug Info Version", i32 1}
179 !11 = metadata !{metadata !"clang version 3.5 "}
180 !12 = metadata !{i32 4, i32 0, metadata !4, null}
181 !13 = metadata !{i32 5, i32 0, metadata !4, null}
182 !14 = metadata !{i32 6, i32 0, metadata !4, null}
0 ; RUN: llc -mtriple=i686-pc-win32 -O0 < %s | FileCheck --check-prefix=X86 %s
1 ; RUN: llc -mtriple=i686-pc-win32 -o - -O0 < %s | llvm-mc -triple=i686-pc-win32 -filetype=obj | llvm-readobj -s -sr -codeview-linetables | FileCheck --check-prefix=OBJ32 %s
2 ; RUN: llc -mtriple=x86_64-pc-win32 -O0 < %s | FileCheck --check-prefix=X64 %s
3 ; RUN: llc -mtriple=x86_64-pc-win32 -o - -O0 < %s | llvm-mc -triple=x86_64-pc-win32 -filetype=obj | llvm-readobj -s -sr -codeview-linetables | FileCheck --check-prefix=OBJ64 %s
4
5 ; This LL file was generated by running clang on the following code:
6 ; D:\input.c:
7 ; 1 void g(void);
8 ; 2
9 ; 3 void f() {
10 ; 4 #line 1 "one.c"
11 ; 5 g(void);
12 ; 6 #line 2 "two.c"
13 ; 7 g(void);
14 ; 8 #line 7 "one.c"
15 ; 9 g(void);
16 ; 10 }
17
18 ; X86: _f:
19 ; X86-NEXT: # BB
20 ; X86-NEXT: [[CALL_LINE_1:.*]]:{{$}}
21 ; X86-NEXT: calll _g
22 ; X86-NEXT: [[CALL_LINE_2:.*]]:{{$}}
23 ; X86-NEXT: calll _g
24 ; X86-NEXT: [[CALL_LINE_3:.*]]:{{$}}
25 ; X86-NEXT: calll _g
26 ; X86-NEXT: [[RETURN_STMT:.*]]:
27 ; X86-NEXT: ret
28 ; X86-NEXT: [[END_OF_F:.*]]:
29 ;
30 ; X86: .section .debug$S,"rn"
31 ; X86-NEXT: .long 4
32 ; X86-NEXT: .long 242
33 ; X86-NEXT: .long [[F2_END:.*]]-[[F2_START:.*]]
34 ; X86-NEXT: [[F2_START]]:
35 ; X86-NEXT: .secrel32 _f
36 ; X86-NEXT: .secidx _f
37 ; X86-NEXT: .long [[END_OF_F]]-_f
38 ; Segment for file 'D:\\one.c' begins
39 ; X86-NEXT: [[FILE_SEGMENT_START:[^:]*]]:
40 ; X86-NEXT: .long 0
41 ; X86-NEXT: .long 1
42 ; X86-NEXT: .long [[FILE_SEGMENT_END:.*]]-[[FILE_SEGMENT_START]]
43 ; X86-NEXT: .long [[CALL_LINE_1]]-_f
44 ; X86-NEXT: .long 1
45 ; X86-NEXT: [[FILE_SEGMENT_END]]:
46 ; Segment for file 'D:\\two.c' begins
47 ; X86-NEXT: [[FILE_SEGMENT_START:[^:]*]]:
48 ; X86-NEXT: .long 8
49 ; X86-NEXT: .long 1
50 ; X86-NEXT: .long [[FILE_SEGMENT_END:.*]]-[[FILE_SEGMENT_START]]
51 ; X86-NEXT: .long [[CALL_LINE_2]]-_f
52 ; X86-NEXT: .long 2
53 ; X86-NEXT: [[FILE_SEGMENT_END]]:
54 ; A new segment for file 'D:\\one.c' begins
55 ; X86-NEXT: [[FILE_SEGMENT_START:[^:]*]]:
56 ; X86-NEXT: .long 0
57 ; X86-NEXT: .long 2
58 ; X86-NEXT: .long [[FILE_SEGMENT_END:.*]]-[[FILE_SEGMENT_START]]
59 ; X86-NEXT: .long [[CALL_LINE_3]]-_f
60 ; X86-NEXT: .long 7
61 ; X86-NEXT: .long [[RETURN_STMT]]-_f
62 ; X86-NEXT: .long 8
63 ; X86-NEXT: [[FILE_SEGMENT_END]]:
64 ; X86-NEXT: [[F2_END]]:
65 ; File index to string table offset subsection
66 ; X86-NEXT: .long 244
67 ; X86-NEXT: .long 16
68 ; X86-NEXT: .long 1
69 ; X86-NEXT: .long 0
70 ; X86-NEXT: .long 10
71 ; X86-NEXT: .long 0
72 ; String table
73 ; X86-NEXT: .long 243
74 ; X86-NEXT: .long 19
75 ; X86-NEXT: .byte 0
76 ; X86-NEXT: .ascii "D:\\one.c"
77 ; X86-NEXT: .byte 0
78 ; X86-NEXT: .ascii "D:\\two.c"
79 ; X86-NEXT: .byte 0
80 ; X86-NEXT: .zero 1
81
82 ; OBJ32: Section {
83 ; OBJ32: Name: .debug$S (2E 64 65 62 75 67 24 53)
84 ; OBJ32: Characteristics [ (0x42100040)
85 ; OBJ32: ]
86 ; OBJ32: Relocations [
87 ; OBJ32-NEXT: 0xC IMAGE_REL_I386_SECREL _f
88 ; OBJ32-NEXT: 0x10 IMAGE_REL_I386_SECTION _f
89 ; OBJ32-NEXT: ]
90 ; OBJ32: FunctionLineTable [
91 ; OBJ32-NEXT: Name: _f
92 ; OBJ32-NEXT: CodeSize: 0x10
93 ; OBJ32-NEXT: FilenameSegment [
94 ; OBJ32-NEXT: Filename: D:\one.c
95 ; OBJ32-NEXT: +0x0: 1
96 ; OBJ32-NEXT: ]
97 ; OBJ32-NEXT: FilenameSegment [
98 ; OBJ32-NEXT: Filename: D:\two.c
99 ; OBJ32-NEXT: +0x5: 2
100 ; OBJ32-NEXT: ]
101 ; OBJ32-NEXT: FilenameSegment [
102 ; OBJ32-NEXT: Filename: D:\one.c
103 ; OBJ32-NEXT: +0xA: 7
104 ; OBJ32-NEXT: +0xF: 8
105 ; OBJ32-NEXT: ]
106 ; OBJ32-NEXT: ]
107 ; OBJ32: }
108
109 ; X64: f:
110 ; X64-NEXT: [[START:.*]]:{{$}}
111 ; X64-NEXT: # BB
112 ; X64-NEXT: subq $40, %rsp
113 ; X64-NEXT: [[CALL_LINE_1:.*]]:{{$}}
114 ; X64-NEXT: callq g
115 ; X64-NEXT: [[CALL_LINE_2:.*]]:{{$}}
116 ; X64-NEXT: callq g
117 ; X64-NEXT: [[CALL_LINE_3:.*]]:{{$}}
118 ; X64-NEXT: callq g
119 ; X64-NEXT: [[EPILOG_AND_RET:.*]]:
120 ; X64-NEXT: addq $40, %rsp
121 ; X64-NEXT: ret
122 ; X64-NEXT: [[END_OF_F:.*]]:
123 ;
124 ; X64: .section .debug$S,"rn"
125 ; X64-NEXT: .long 4
126 ; X64-NEXT: .long 242
127 ; X64-NEXT: .long [[F2_END:.*]]-[[F2_START:.*]]
128 ; X64-NEXT: [[F2_START]]:
129 ; X64-NEXT: .secrel32 f
130 ; X64-NEXT: .secidx f
131 ; X64-NEXT: .long [[END_OF_F]]-f
132 ; Segment for file 'D:\\input.c' begins
133 ; X64-NEXT: [[FILE_SEGMENT_START:[^:]*]]:
134 ; X64-NEXT: .long 0
135 ; X64-NEXT: .long 1
136 ; X64-NEXT: .long [[FILE_SEGMENT_END:.*]]-[[FILE_SEGMENT_START]]
137 ; X64-NEXT: .long [[START]]-f
138 ; X64-NEXT: .long 3
139 ; X64-NEXT: [[FILE_SEGMENT_END]]:
140 ; Segment for file 'D:\\one.c' begins
141 ; X64-NEXT: [[FILE_SEGMENT_START:[^:]*]]:
142 ; X64-NEXT: .long 8
143 ; X64-NEXT: .long 1
144 ; X64-NEXT: .long [[FILE_SEGMENT_END:.*]]-[[FILE_SEGMENT_START]]
145 ; X64-NEXT: .long [[CALL_LINE_1]]-f
146 ; X64-NEXT: .long 1
147 ; X64-NEXT: [[FILE_SEGMENT_END]]:
148 ; Segment for file 'D:\\two.c' begins
149 ; X64-NEXT: [[FILE_SEGMENT_START:[^:]*]]:
150 ; X64-NEXT: .long 16
151 ; X64-NEXT: .long 1
152 ; X64-NEXT: .long [[FILE_SEGMENT_END:.*]]-[[FILE_SEGMENT_START]]
153 ; X64-NEXT: .long [[CALL_LINE_2]]-f
154 ; X64-NEXT: .long 2
155 ; X64-NEXT: [[FILE_SEGMENT_END]]:
156 ; A new segment for file 'D:\\one.c' begins
157 ; X64-NEXT: [[FILE_SEGMENT_START:[^:]*]]:
158 ; X64-NEXT: .long 8
159 ; X64-NEXT: .long 2
160 ; X64-NEXT: .long [[FILE_SEGMENT_END:.*]]-[[FILE_SEGMENT_START]]
161 ; X64-NEXT: .long [[CALL_LINE_3]]-f
162 ; X64-NEXT: .long 7
163 ; X64-NEXT: .long [[EPILOG_AND_RET]]-f
164 ; X64-NEXT: .long 8
165 ; X64-NEXT: [[FILE_SEGMENT_END]]:
166 ; X64-NEXT: [[F2_END]]:
167 ; File index to string table offset subsection
168 ; X64-NEXT: .long 244
169 ; X64-NEXT: .long 24
170 ; X64-NEXT: .long 1
171 ; X64-NEXT: .long 0
172 ; X64-NEXT: .long 12
173 ; X64-NEXT: .long 0
174 ; X64-NEXT: .long 21
175 ; X64-NEXT: .long 0
176 ; String table
177 ; X64-NEXT: .long 243
178 ; X64-NEXT: .long 30
179 ; X64-NEXT: .byte 0
180 ; X64-NEXT: .ascii "D:\\input.c"
181 ; X64-NEXT: .byte 0
182 ; X64-NEXT: .ascii "D:\\one.c"
183 ; X64-NEXT: .byte 0
184 ; X64-NEXT: .ascii "D:\\two.c"
185 ; X64-NEXT: .byte 0
186 ; X64-NEXT: .zero 2
187
188 ; OBJ64: Section {
189 ; OBJ64: Name: .debug$S (2E 64 65 62 75 67 24 53)
190 ; OBJ64: Characteristics [ (0x42100040)
191 ; OBJ64: ]
192 ; OBJ64: Relocations [
193 ; OBJ64-NEXT: 0xC IMAGE_REL_AMD64_SECREL f
194 ; OBJ64-NEXT: 0x10 IMAGE_REL_AMD64_SECTION f
195 ; OBJ64-NEXT: ]
196 ; OBJ64: FunctionLineTable [
197 ; OBJ64-NEXT: Name: f
198 ; OBJ64-NEXT: CodeSize: 0x18
199 ; OBJ64-NEXT: FilenameSegment [
200 ; OBJ64-NEXT: Filename: D:\input.c
201 ; OBJ64-NEXT: +0x0: 3
202 ; OBJ64-NEXT: ]
203 ; OBJ64-NEXT: FilenameSegment [
204 ; OBJ64-NEXT: Filename: D:\one.c
205 ; OBJ64-NEXT: +0x4: 1
206 ; OBJ64-NEXT: ]
207 ; OBJ64-NEXT: FilenameSegment [
208 ; OBJ64-NEXT: Filename: D:\two.c
209 ; OBJ64-NEXT: +0x9: 2
210 ; OBJ64-NEXT: ]
211 ; OBJ64-NEXT: FilenameSegment [
212 ; OBJ64-NEXT: Filename: D:\one.c
213 ; OBJ64-NEXT: +0xE: 7
214 ; OBJ64-NEXT: +0x13: 8
215 ; OBJ64-NEXT: ]
216 ; OBJ64-NEXT: ]
217 ; OBJ64: }
218
219 ; Function Attrs: nounwind
220 define void @f() #0 {
221 entry:
222 call void @g(), !dbg !12
223 call void @g(), !dbg !15
224 call void @g(), !dbg !18
225 ret void, !dbg !19
226 }
227
228 declare void @g() #1
229
230 attributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-realign-stack" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
231 attributes #1 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-realign-stack" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
232
233 !llvm.dbg.cu = !{!0}
234 !llvm.module.flags = !{!9, !10}
235 !llvm.ident = !{!11}
236
237 !0 = metadata !{i32 786449, metadata !1, i32 12, metadata !"clang version 3.5 ", i1 false, metadata !"", i32 0, metadata !2, metadata !2, metadata !3, metadata !2, metadata !2, metadata !""} ; [ DW_TAG_compile_unit ] [D:\/] [DW_LANG_C99]
238 !1 = metadata !{metadata !"", metadata !"D:\5C"}
239 !2 = metadata !{i32 0}
240 !3 = metadata !{metadata !4}
241 !4 = metadata !{i32 786478, metadata !5, metadata !6, metadata !"f", metadata !"f", metadata !"", i32 3, metadata !7, i1 false, i1 true, i32 0, i32 0, null, i32 256, i1 false, void ()* @f, null, null, metadata !2, i32 3} ; [ DW_TAG_subprogram ] [line 3] [def] [f]
242 !5 = metadata !{metadata !"input.c", metadata !"D:\5C"}
243 !6 = metadata !{i32 786473, metadata !5} ; [ DW_TAG_file_type ] [D:\/input.c]
244 !7 = metadata !{i32 786453, i32 0, null, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !8, i32 0, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
245 !8 = metadata !{null}
246 !9 = metadata !{i32 2, metadata !"Dwarf Version", i32 4}
247 !10 = metadata !{i32 1, metadata !"Debug Info Version", i32 1}
248 !11 = metadata !{metadata !"clang version 3.5 "}
249 !12 = metadata !{i32 1, i32 0, metadata !13, null}
250 !13 = metadata !{i32 786443, metadata !14, metadata !4} ; [ DW_TAG_lexical_block ] [D:\/one.c]
251 !14 = metadata !{metadata !"one.c", metadata !"D:\5C"}
252 !15 = metadata !{i32 2, i32 0, metadata !16, null}
253 !16 = metadata !{i32 786443, metadata !17, metadata !4} ; [ DW_TAG_lexical_block ] [D:\/two.c]
254 !17 = metadata !{metadata !"two.c", metadata !"D:\5C"}
255 !18 = metadata !{i32 7, i32 0, metadata !13, null}
256 !19 = metadata !{i32 8, i32 0, metadata !13, null} ; [ DW_TAG_imported_declaration ]
0 ; RUN: llc -mtriple=i686-pc-win32 -O0 < %s | FileCheck --check-prefix=X86 %s
1 ; RUN: llc -mtriple=i686-pc-win32 -o - -O0 < %s | llvm-mc -triple=i686-pc-win32 -filetype=obj | llvm-readobj -s -sr -codeview-linetables | FileCheck --check-prefix=OBJ32 %s
2 ; RUN: llc -mtriple=x86_64-pc-win32 -O0 < %s | FileCheck --check-prefix=X64 %s
3 ; RUN: llc -mtriple=x86_64-pc-win32 -o - -O0 < %s | llvm-mc -triple=x86_64-pc-win32 -filetype=obj | llvm-readobj -s -sr -codeview-linetables | FileCheck --check-prefix=OBJ64 %s
4
5 ; This LL file was generated by running clang on the following code:
6 ; D:\source.c:
7 ; 1 void z(void);
8 ; 2
9 ; 3 void x(void) {
10 ; 4 z();
11 ; 5 }
12 ; 6
13 ; 7 void y(void) {
14 ; 8 z();
15 ; 9 }
16 ; 10
17 ; 11 void f(void) {
18 ; 12 x();
19 ; 13 y();
20 ; 14 z();
21 ; 15 }
22
23
24 ; X86: _x:
25 ; X86-NEXT: # BB
26 ; X86-NEXT: [[X_CALL:.*]]:{{$}}
27 ; X86-NEXT: calll _z
28 ; X86-NEXT: [[X_RETURN:.*]]:
29 ; X86-NEXT: ret
30 ; X86-NEXT: [[END_OF_X:.*]]:
31 ;
32 ; X86: _y:
33 ; X86-NEXT: # BB
34 ; X86-NEXT: [[Y_CALL:.*]]:{{$}}
35 ; X86-NEXT: calll _z
36 ; X86-NEXT: [[Y_RETURN:.*]]:
37 ; X86-NEXT: ret
38 ; X86-NEXT: [[END_OF_Y:.*]]:
39 ;
40 ; X86: _f:
41 ; X86-NEXT: # BB
42 ; X86-NEXT: [[F_CALLS_X:.*]]:{{$}}
43 ; X86-NEXT: calll _x
44 ; X86-NEXT: [[F_CALLS_Y:.*]]:
45 ; X86-NEXT: calll _y
46 ; X86-NEXT: [[F_CALLS_Z:.*]]:
47 ; X86-NEXT: calll _z
48 ; X86-NEXT: [[F_RETURN:.*]]:
49 ; X86-NEXT: ret
50 ; X86-NEXT: [[END_OF_F:.*]]:
51 ;
52 ; X86: .section .debug$S,"rn"
53 ; X86-NEXT: .long 4
54 ; Line table subsection for x
55 ; X86-NEXT: .long 242
56 ; X86-NEXT: .long [[F2_END:.*]]-[[F2_START:.*]]
57 ; X86-NEXT: [[F2_START]]:
58 ; X86-NEXT: .secrel32 _x
59 ; X86-NEXT: .secidx _x
60 ; X86-NEXT: .long [[END_OF_X]]-_x
61 ; X86-NEXT: [[FILE_SEGMENT_START:[^:]*]]:
62 ; X86-NEXT: .long 0
63 ; X86-NEXT: .long 2
64 ; X86-NEXT: .long [[FILE_SEGMENT_END:.*]]-[[FILE_SEGMENT_START]]
65 ; X86-NEXT: .long [[X_CALL]]-_x
66 ; X86-NEXT: .long 4
67 ; X86-NEXT: .long [[X_RETURN]]-_x
68 ; X86-NEXT: .long 5
69 ; X86-NEXT: [[FILE_SEGMENT_END]]:
70 ; X86-NEXT: [[F2_END]]:
71 ; Line table subsection for y
72 ; X86-NEXT: .long 242
73 ; X86-NEXT: .long [[F2_END:.*]]-[[F2_START:.*]]
74 ; X86-NEXT: [[F2_START]]:
75 ; X86-NEXT: .secrel32 _y
76 ; X86-NEXT: .secidx _y
77 ; X86-NEXT: .long [[END_OF_Y]]-_y
78 ; X86-NEXT: [[FILE_SEGMENT_START:[^:]*]]:
79 ; X86-NEXT: .long 0
80 ; X86-NEXT: .long 2
81 ; X86-NEXT: .long [[FILE_SEGMENT_END:.*]]-[[FILE_SEGMENT_START]]
82 ; X86-NEXT: .long [[Y_CALL]]-_y
83 ; X86-NEXT: .long 8
84 ; X86-NEXT: .long [[Y_RETURN]]-_y
85 ; X86-NEXT: .long 9
86 ; X86-NEXT: [[FILE_SEGMENT_END]]:
87 ; X86-NEXT: [[F2_END]]:
88 ; Line table subsection for f
89 ; X86-NEXT: .long 242
90 ; X86-NEXT: .long [[F2_END:.*]]-[[F2_START:.*]]
91 ; X86-NEXT: [[F2_START]]:
92 ; X86-NEXT: .secrel32 _f
93 ; X86-NEXT: .secidx _f
94 ; X86-NEXT: .long [[END_OF_F]]-_f
95 ; X86-NEXT: [[FILE_SEGMENT_START:[^:]*]]:
96 ; X86-NEXT: .long 0
97 ; X86-NEXT: .long 4
98 ; X86-NEXT: .long [[FILE_SEGMENT_END:.*]]-[[FILE_SEGMENT_START]]
99 ; X86-NEXT: .long [[F_CALLS_X]]-_f
100 ; X86-NEXT: .long 12
101 ; X86-NEXT: .long [[F_CALLS_Y]]-_f
102 ; X86-NEXT: .long 13
103 ; X86-NEXT: .long [[F_CALLS_Z]]-_f
104 ; X86-NEXT: .long 14
105 ; X86-NEXT: .long [[F_RETURN]]-_f
106 ; X86-NEXT: .long 15
107 ; X86-NEXT: [[FILE_SEGMENT_END]]:
108 ; X86-NEXT: [[F2_END]]:
109 ; File index to string table offset subsection
110 ; X86-NEXT: .long 244
111 ; X86-NEXT: .long 8
112 ; X86-NEXT: .long 1
113 ; X86-NEXT: .long 0
114 ; String table
115 ; X86-NEXT: .long 243
116 ; X86-NEXT: .long 13
117 ; X86-NEXT: .byte 0
118 ; X86-NEXT: .ascii "D:\\source.c"
119 ; X86-NEXT: .byte 0
120 ; X86-NEXT: .zero 3
121
122 ; OBJ32: Section {
123 ; OBJ32: Name: .debug$S (2E 64 65 62 75 67 24 53)
124 ; OBJ32: Characteristics [ (0x42100040)
125 ; OBJ32: ]
126 ; OBJ32: Relocations [
127 ; OBJ32-NEXT: 0xC IMAGE_REL_I386_SECREL _x
128 ; OBJ32-NEXT: 0x10 IMAGE_REL_I386_SECTION _x
129 ; OBJ32-NEXT: 0x3C IMAGE_REL_I386_SECREL _y
130 ; OBJ32-NEXT: 0x40 IMAGE_REL_I386_SECTION _y
131 ; OBJ32-NEXT: 0x6C IMAGE_REL_I386_SECREL _f
132 ; OBJ32-NEXT: 0x70 IMAGE_REL_I386_SECTION _f
133 ; OBJ32-NEXT: ]
134 ; OBJ32: FunctionLineTable [
135 ; OBJ32-NEXT: Name: _x
136 ; OBJ32-NEXT: CodeSize: 0x6
137 ; OBJ32-NEXT: FilenameSegment [
138 ; OBJ32-NEXT: Filename: D:\source.c
139 ; OBJ32-NEXT: +0x0: 4
140 ; OBJ32-NEXT: +0x5: 5
141 ; OBJ32-NEXT: ]
142 ; OBJ32-NEXT: ]
143 ; OBJ32-NEXT: FunctionLineTable [
144 ; OBJ32-NEXT: Name: _y
145 ; OBJ32-NEXT: CodeSize: 0x6
146 ; OBJ32-NEXT: FilenameSegment [
147 ; OBJ32-NEXT: Filename: D:\source.c
148 ; OBJ32-NEXT: +0x0: 8
149 ; OBJ32-NEXT: +0x5: 9
150 ; OBJ32-NEXT: ]
151 ; OBJ32-NEXT: ]
152 ; OBJ32-NEXT: FunctionLineTable [
153 ; OBJ32-NEXT: Name: _f
154 ; OBJ32-NEXT: CodeSize: 0x10
155 ; OBJ32-NEXT: FilenameSegment [
156 ; OBJ32-NEXT: Filename: D:\source.c
157 ; OBJ32-NEXT: +0x0: 12
158 ; OBJ32-NEXT: +0x5: 13
159 ; OBJ32-NEXT: +0xA: 14
160 ; OBJ32-NEXT: +0xF: 15
161 ; OBJ32-NEXT: ]
162 ; OBJ32-NEXT: ]
163 ; OBJ32: }
164
165 ; X64: x:
166 ; X64-NEXT: [[X_START:.*]]:{{$}}
167 ; X64-NEXT: # BB
168 ; X64-NEXT: subq $40, %rsp
169 ; X64-NEXT: [[X_CALL_LINE:.*]]:{{$}}
170 ; X64-NEXT: callq z
171 ; X64-NEXT: [[X_EPILOG_AND_RET:.*]]:
172 ; X64-NEXT: addq $40, %rsp
173 ; X64-NEXT: ret
174 ; X64-NEXT: [[END_OF_X:.*]]:
175 ;
176 ; X64: y:
177 ; X64-NEXT: [[Y_START:.*]]:{{$}}
178 ; X64-NEXT: # BB
179 ; X64-NEXT: subq $40, %rsp
180 ; X64-NEXT: [[Y_CALL_LINE:.*]]:{{$}}
181 ; X64-NEXT: callq z
182 ; X64-NEXT: [[Y_EPILOG_AND_RET:.*]]:
183 ; X64-NEXT: addq $40, %rsp
184 ; X64-NEXT: ret
185 ; X64-NEXT: [[END_OF_Y:.*]]:
186 ;
187 ; X64: f:
188 ; X64-NEXT: [[F_START:.*]]:{{$}}
189 ; X64-NEXT: # BB
190 ; X64-NEXT: subq $40, %rsp
191 ; X64-NEXT: [[F_CALLS_X:.*]]:{{$}}
192 ; X64-NEXT: callq x
193 ; X64-NEXT: [[F_CALLS_Y:.*]]:
194 ; X64-NEXT: callq y
195 ; X64-NEXT: [[F_CALLS_Z:.*]]:
196 ; X64-NEXT: callq z
197 ; X64-NEXT: [[F_EPILOG_AND_RET:.*]]:
198 ; X64-NEXT: addq $40, %rsp
199 ; X64-NEXT: ret
200 ; X64-NEXT: [[END_OF_F:.*]]:
201 ;
202 ; X64: .section .debug$S,"rn"
203 ; X64-NEXT: .long 4
204 ; Line table subsection for x
205 ; X64-NEXT: .long 242
206 ; X64-NEXT: .long [[F2_END:.*]]-[[F2_START:.*]]
207 ; X64-NEXT: [[F2_START]]:
208 ; X64-NEXT: .secrel32 x
209 ; X64-NEXT: .secidx x
210 ; X64-NEXT: .long [[END_OF_X]]-x
211 ; X64-NEXT: [[FILE_SEGMENT_START:[^:]*]]:
212 ; X64-NEXT: .long 0
213 ; X64-NEXT: .long 3
214 ; X64-NEXT: .long [[FILE_SEGMENT_END:.*]]-[[FILE_SEGMENT_START]]
215 ; X64-NEXT: .long [[X_START]]-x
216 ; X64-NEXT: .long 3
217 ; X64-NEXT: .long [[X_CALL_LINE]]-x
218 ; X64-NEXT: .long 4
219 ; X64-NEXT: .long [[X_EPILOG_AND_RET]]-x
220 ; X64-NEXT: .long 5
221 ; X64-NEXT: [[FILE_SEGMENT_END]]:
222 ; X64-NEXT: [[F2_END]]:
223 ; Line table subsection for y
224 ; X64-NEXT: .long 242
225 ; X64-NEXT: .long [[F2_END:.*]]-[[F2_START:.*]]
226 ; X64-NEXT: [[F2_START]]:
227 ; X64-NEXT: .secrel32 y
228 ; X64-NEXT: .secidx y
229 ; X64-NEXT: .long [[END_OF_Y]]-y
230 ; X64-NEXT: [[FILE_SEGMENT_START:[^:]*]]:
231 ; X64-NEXT: .long 0
232 ; X64-NEXT: .long 3
233 ; X64-NEXT: .long [[FILE_SEGMENT_END:.*]]-[[FILE_SEGMENT_START]]
234 ; X64-NEXT: .long [[Y_START]]-y
235 ; X64-NEXT: .long 7
236 ; X64-NEXT: .long [[Y_CALL_LINE]]-y
237 ; X64-NEXT: .long 8
238 ; X64-NEXT: .long [[Y_EPILOG_AND_RET]]-y
239 ; X64-NEXT: .long 9
240 ; X64-NEXT: [[FILE_SEGMENT_END]]:
241 ; X64-NEXT: [[F2_END]]:
242 ; Line table subsection for f
243 ; X64-NEXT: .long 242
244 ; X64-NEXT: .long [[F2_END:.*]]-[[F2_START:.*]]
245 ; X64-NEXT: [[F2_START]]:
246 ; X64-NEXT: .secrel32 f
247 ; X64-NEXT: .secidx f
248 ; X64-NEXT: .long [[END_OF_F]]-f
249 ; X64-NEXT: [[FILE_SEGMENT_START:[^:]*]]:
250 ; X64-NEXT: .long 0
251 ; X64-NEXT: .long 5
252 ; X64-NEXT: .long [[FILE_SEGMENT_END:.*]]-[[FILE_SEGMENT_START]]
253 ; X64-NEXT: .long [[F_START]]-f
254 ; X64-NEXT: .long 11
255 ; X64-NEXT: .long [[F_CALLS_X]]-f
256 ; X64-NEXT: .long 12
257 ; X64-NEXT: .long [[F_CALLS_Y]]-f
258 ; X64-NEXT: .long 13
259 ; X64-NEXT: .long [[F_CALLS_Z]]-f
260 ; X64-NEXT: .long 14
261 ; X64-NEXT: .long [[F_EPILOG_AND_RET]]-f
262 ; X64-NEXT: .long 15
263 ; X64-NEXT: [[FILE_SEGMENT_END]]:
264 ; X64-NEXT: [[F2_END]]:
265 ; File index to string table offset subsection
266 ; X64-NEXT: .long 244
267 ; X64-NEXT: .long 8
268 ; X64-NEXT: .long 1
269 ; X64-NEXT: .long 0
270 ; String table
271 ; X64-NEXT: .long 243
272 ; X64-NEXT: .long 13
273 ; X64-NEXT: .byte 0
274 ; X64-NEXT: .ascii "D:\\source.c"
275 ; X64-NEXT: .byte 0
276 ; X64-NEXT: .zero 3
277
278 ; OBJ64: Section {
279 ; OBJ64: Name: .debug$S (2E 64 65 62 75 67 24 53)
280 ; OBJ64: Characteristics [ (0x42100040)
281 ; OBJ64: ]
282 ; OBJ64: Relocations [
283 ; OBJ64-NEXT: 0xC IMAGE_REL_AMD64_SECREL x
284 ; OBJ64-NEXT: 0x10 IMAGE_REL_AMD64_SECTION x
285 ; OBJ64-NEXT: 0x44 IMAGE_REL_AMD64_SECREL y
286 ; OBJ64-NEXT: 0x48 IMAGE_REL_AMD64_SECTION y
287 ; OBJ64-NEXT: 0x7C IMAGE_REL_AMD64_SECREL f
288 ; OBJ64-NEXT: 0x80 IMAGE_REL_AMD64_SECTION f
289 ; OBJ64-NEXT: ]
290 ; OBJ64: FunctionLineTable [
291 ; OBJ64-NEXT: Name: x
292 ; OBJ64-NEXT: CodeSize: 0xE
293 ; OBJ64-NEXT: FilenameSegment [
294 ; OBJ64-NEXT: Filename: D:\source.c
295 ; OBJ64-NEXT: +0x0: 3
296 ; OBJ64-NEXT: +0x4: 4
297 ; OBJ64-NEXT: +0x9: 5
298 ; OBJ64-NEXT: ]
299 ; OBJ64-NEXT: ]
300 ; OBJ64-NEXT: FunctionLineTable [
301 ; OBJ64-NEXT: Name: y
302 ; OBJ64-NEXT: CodeSize: 0xE
303 ; OBJ64-NEXT: FilenameSegment [
304 ; OBJ64-NEXT: Filename: D:\source.c
305 ; OBJ64-NEXT: +0x0: 7
306 ; OBJ64-NEXT: +0x4: 8
307 ; OBJ64-NEXT: +0x9: 9
308 ; OBJ64-NEXT: ]
309 ; OBJ64-NEXT: ]
310 ; OBJ64-NEXT: FunctionLineTable [
311 ; OBJ64-NEXT: Name: f
312 ; OBJ64-NEXT: CodeSize: 0x18
313 ; OBJ64-NEXT: FilenameSegment [
314 ; OBJ64-NEXT: Filename: D:\source.c
315 ; OBJ64-NEXT: +0x0: 11
316 ; OBJ64-NEXT: +0x4: 12
317 ; OBJ64-NEXT: +0x9: 13
318 ; OBJ64-NEXT: +0xE: 14
319 ; OBJ64-NEXT: +0x13: 15
320 ; OBJ64-NEXT: ]
321 ; OBJ64-NEXT: ]
322 ; OBJ64: }
323
324 ; Function Attrs: nounwind
325 define void @x() #0 {
326 entry:
327 call void @z(), !dbg !14
328 ret void, !dbg !15
329 }
330
331 declare void @z() #1
332
333 ; Function Attrs: nounwind
334 define void @y() #0 {
335 entry:
336 call void @z(), !dbg !16
337 ret void, !dbg !17
338 }
339
340 ; Function Attrs: nounwind
341 define void @f() #0 {
342 entry:
343 call void @x(), !dbg !18
344 call void @y(), !dbg !19
345 call void @z(), !dbg !20
346 ret void, !dbg !21
347 }
348
349 attributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-realign-stack" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
350 attributes #1 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-realign-stack" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
351
352 !llvm.dbg.cu = !{!0}
353 !llvm.module.flags = !{!11, !12}
354 !llvm.ident = !{!13}
355
356 !0 = metadata !{i32 786449, metadata !1, i32 12, metadata !"clang version 3.5 ", i1 false, metadata !"", i32 0, metadata !2, metadata !2, metadata !3, metadata !2, metadata !2, metadata !""} ; [ DW_TAG_compile_unit ] [D:\/] [DW_LANG_C99]
357 !1 = metadata !{metadata !"", metadata !"D:\5C"}
358 !2 = metadata !{i32 0}
359 !3 = metadata !{metadata !4, metadata !9, metadata !10}
360 !4 = metadata !{i32 786478, metadata !5, metadata !6, metadata !"x", metadata !"x", metadata !"", i32 3, metadata !7, i1 false, i1 true, i32 0, i32 0, null, i32 256, i1 false, void ()* @x, null, null, metadata !2, i32 3} ; [ DW_TAG_subprogram ] [line 3] [def] [x]
361 !5 = metadata !{metadata !"source.c", metadata !"D:\5C"}
362 !6 = metadata !{i32 786473, metadata !5} ; [ DW_TAG_file_type ] [D:\/source.c]
363 !7 = metadata !{i32 786453, i32 0, null, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !8, i32 0, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
364 !8 = metadata !{null}
365 !9 = metadata !{i32 786478, metadata !5, metadata !6, metadata !"y", metadata !"y", metadata !"", i32 7, metadata !7, i1 false, i1 true, i32 0, i32 0, null, i32 256, i1 false, void ()* @y, null, null, metadata !2, i32 7} ; [ DW_TAG_subprogram ] [line 7] [def] [y]
366 !10 = metadata !{i32 786478, metadata !5, metadata !6, metadata !"f", metadata !"f", metadata !"", i32 11, metadata !7, i1 false, i1 true, i32 0, i32 0, null, i32 256, i1 false, void ()* @f, null, null, metadata !2, i32 11} ; [ DW_TAG_subprogram ] [line 11] [def] [f]
367 !11 = metadata !{i32 2, metadata !"Dwarf Version", i32 4}
368 !12 = metadata !{i32 1, metadata !"Debug Info Version", i32 1}
369 !13 = metadata !{metadata !"clang version 3.5 "}
370 !14 = metadata !{i32 4, i32 0, metadata !4, null}
371 !15 = metadata !{i32 5, i32 0, metadata !4, null}
372 !16 = metadata !{i32 8, i32 0, metadata !9, null} ; [ DW_TAG_imported_declaration ]
373 !17 = metadata !{i32 9, i32 0, metadata !9, null}
374 !18 = metadata !{i32 12, i32 0, metadata !10, null}
375 !19 = metadata !{i32 13, i32 0, metadata !10, null}
376 !20 = metadata !{i32 14, i32 0, metadata !10, null}
377 !21 = metadata !{i32 15, i32 0, metadata !10, null}
0 ; RUN: llc -mtriple=i686-pc-win32 -O0 < %s | FileCheck --check-prefix=X86 %s
1 ; RUN: llc -mtriple=i686-pc-win32 -o - -O0 < %s | llvm-mc -triple=i686-pc-win32 -filetype=obj | llvm-readobj -s -sr -codeview-linetables | FileCheck --check-prefix=OBJ32 %s
2 ; RUN: llc -mtriple=x86_64-pc-win32 -O0 < %s | FileCheck --check-prefix=X64 %s
3 ; RUN: llc -mtriple=x86_64-pc-win32 -o - -O0 < %s | llvm-mc -triple=x86_64-pc-win32 -filetype=obj | llvm-readobj -s -sr -codeview-linetables | FileCheck --check-prefix=OBJ64 %s
4
5 ; This LL file was generated by running clang on the following code:
6 ; D:\test.c:
7 ; 1 void g(void);
8 ; 2
9 ; 3 void f(void) {
10 ; 4 g();
11 ; 5 }
12
13 ; X86: _f:
14 ; X86-NEXT: # BB
15 ; X86-NEXT: [[CALL_LINE:^L.*]]:{{$}}
16 ; X86-NEXT: calll _g
17 ; X86-NEXT: [[RETURN_STMT:.*]]:
18 ; X86-NEXT: ret
19 ; X86-NEXT: [[END_OF_F:.*]]:
20 ;
21 ; X86: .section .debug$S,"rn"
22 ; X86-NEXT: .long 4
23 ; X86-NEXT: .long 242
24 ; X86-NEXT: .long [[F2_END:.*]]-[[F2_START:.*]]
25 ; X86-NEXT: [[F2_START]]:
26 ; X86-NEXT: .secrel32 _f
27 ; X86-NEXT: .secidx _f
28 ; X86-NEXT: .long [[END_OF_F]]-_f
29 ; X86-NEXT: [[FILE_SEGMENT_START:[^:]*]]:
30 ; X86-NEXT: .long 0
31 ; X86-NEXT: .long 2
32 ; X86-NEXT: .long [[FILE_SEGMENT_END:.*]]-[[FILE_SEGMENT_START]]
33 ; X86-NEXT: .long [[CALL_LINE]]-_f
34 ; X86-NEXT: .long 4
35 ; X86-NEXT: .long [[RETURN_STMT]]-_f
36 ; X86-NEXT: .long 5
37 ; X86-NEXT: [[FILE_SEGMENT_END]]:
38 ; X86-NEXT: [[F2_END]]:
39 ; File index to string table offset subsection
40 ; X86-NEXT: .long 244
41 ; X86-NEXT: .long 8
42 ; X86-NEXT: .long 1
43 ; X86-NEXT: .long 0
44 ; String table
45 ; X86-NEXT: .long 243
46 ; X86-NEXT: .long 11
47 ; X86-NEXT: .byte 0
48 ; X86-NEXT: .ascii "D:\\test.c"
49 ; X86-NEXT: .byte 0
50 ; Padding
51 ; X86-NEXT: .zero 1
52
53 ; OBJ32: Section {
54 ; OBJ32: Name: .debug$S (2E 64 65 62 75 67 24 53)
55 ; OBJ32: Characteristics [ (0x42100040)
56 ; OBJ32: ]
57 ; OBJ32: Relocations [
58 ; OBJ32-NEXT: 0xC IMAGE_REL_I386_SECREL _f
59 ; OBJ32-NEXT: 0x10 IMAGE_REL_I386_SECTION _f
60 ; OBJ32-NEXT: ]
61 ; OBJ32: FunctionLineTable [
62 ; OBJ32-NEXT: Name: _f
63 ; OBJ32-NEXT: CodeSize: 0x6
64 ; OBJ32-NEXT: FilenameSegment [
65 ; OBJ32-NEXT: Filename: D:\test.c
66 ; OBJ32-NEXT: +0x0: 4
67 ; OBJ32-NEXT: +0x5: 5
68 ; OBJ32-NEXT: ]
69 ; OBJ32-NEXT: ]
70 ; OBJ32: }
71
72 ; X64: f:
73 ; X64-NEXT: [[START:.*]]:{{$}}
74 ; X64-NEXT: # BB
75 ; X64-NEXT: subq $40, %rsp
76 ; X64-NEXT: [[CALL_LINE:.*]]:{{$}}
77 ; X64-NEXT: callq g
78 ; X64-NEXT: [[EPILOG_AND_RET:.*]]:
79 ; X64-NEXT: addq $40, %rsp
80 ; X64-NEXT: ret
81 ; X64-NEXT: [[END_OF_F:.*]]:
82 ;
83 ; X64: .section .debug$S,"rn"
84 ; X64-NEXT: .long 4
85 ; X64-NEXT: .long 242
86 ; X64-NEXT: .long [[F2_END:.*]]-[[F2_START:.*]]
87 ; X64-NEXT: [[F2_START]]:
88 ; X64-NEXT: .secrel32 f
89 ; X64-NEXT: .secidx f
90 ; X64-NEXT: .long [[END_OF_F]]-f
91 ; X64-NEXT: [[FILE_SEGMENT_START:[^:]*]]:
92 ; X64-NEXT: .long 0
93 ; X64-NEXT: .long 3
94 ; X64-NEXT: .long [[FILE_SEGMENT_END:.*]]-[[FILE_SEGMENT_START]]
95 ; X64-NEXT: .long [[START]]-f
96 ; X64-NEXT: .long 3
97 ; X64-NEXT: .long [[CALL_LINE]]-f
98 ; X64-NEXT: .long 4
99 ; X64-NEXT: .long [[EPILOG_AND_RET]]-f
100 ; X64-NEXT: .long 5
101 ; X64-NEXT: [[FILE_SEGMENT_END]]:
102 ; X64-NEXT: [[F2_END]]:
103 ; File index to string table offset subsection
104 ; X64-NEXT: .long 244
105 ; X64-NEXT: .long 8
106 ; X64-NEXT: .long 1
107 ; X64-NEXT: .long 0
108 ; String table
109 ; X64-NEXT: .long 243
110 ; X64-NEXT: .long 11
111 ; X64-NEXT: .byte 0
112 ; X64-NEXT: .ascii "D:\\test.c"
113 ; X64-NEXT: .byte 0
114 ; Padding
115 ; X64-NEXT: .zero 1
116
117 ; OBJ64: Section {
118 ; OBJ64: Name: .debug$S (2E 64 65 62 75 67 24 53)
119 ; OBJ64: Characteristics [ (0x42100040)
120 ; OBJ64: ]
121 ; OBJ64: Relocations [
122 ; OBJ64-NEXT: 0xC IMAGE_REL_AMD64_SECREL f
123 ; OBJ64-NEXT: 0x10 IMAGE_REL_AMD64_SECTION f
124 ; OBJ64-NEXT: ]
125 ; OBJ64: FunctionLineTable [
126 ; OBJ64-NEXT: Name: f
127 ; OBJ64-NEXT: CodeSize: 0xE
128 ; OBJ64-NEXT: FilenameSegment [
129 ; OBJ64-NEXT: Filename: D:\test.c
130 ; OBJ64-NEXT: +0x0: 3
131 ; OBJ64-NEXT: +0x4: 4
132 ; OBJ64-NEXT: +0x9: 5
133 ; OBJ64-NEXT: ]
134 ; OBJ64-NEXT: ]
135 ; OBJ64: }
136
137 ; Function Attrs: nounwind
138 define void @f() #0 {
139 entry:
140 call void @g(), !dbg !12
141 ret void, !dbg !13
142 }
143
144 declare void @g() #1
145
146 attributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-realign-stack" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
147 attributes #1 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-realign-stack" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
148
149 !llvm.dbg.cu = !{!0}
150 !llvm.module.flags = !{!9, !10}
151 !llvm.ident = !{!11}
152
153 !0 = metadata !{i32 786449, metadata !1, i32 12, metadata !"clang version 3.5 ", i1 false, metadata !"", i32 0, metadata !2, metadata !2, metadata !3, metadata !2, metadata !2, metadata !""} ; [ DW_TAG_compile_unit ] [D:\/] [DW_LANG_C99]
154 !1 = metadata !{metadata !"", metadata !"D:\5C"}
155 !2 = metadata !{i32 0}
156 !3 = metadata !{metadata !4}
157 !4 = metadata !{i32 786478, metadata !5, metadata !6, metadata !"f", metadata !"f", metadata !"", i32 3, metadata !7, i1 false, i1 true, i32 0, i32 0, null, i32 256, i1 false, void ()* @f, null, null, metadata !2, i32 3} ; [ DW_TAG_subprogram ] [line 3] [def] [f]
158 !5 = metadata !{metadata !"test.c", metadata !"D:\5C"}
159 !6 = metadata !{i32 786473, metadata !5} ; [ DW_TAG_file_type ] [D:\/test.c]
160 !7 = metadata !{i32 786453, i32 0, null, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !8, i32 0, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
161 !8 = metadata !{null}
162 !9 = metadata !{i32 2, metadata !"Dwarf Version", i32 4}
163 !10 = metadata !{i32 1, metadata !"Debug Info Version", i32 1}
164 !11 = metadata !{metadata !"clang version 3.5 "}
165 !12 = metadata !{i32 4, i32 0, metadata !4, null}
166 !13 = metadata !{i32 5, i32 0, metadata !4, null}
0 ; RUN: llc -mtriple=i686-pc-mingw32 -filetype=asm -O0 < %s | FileCheck %s
1 ; RUN: llc -mtriple=i686-pc-cygwin -filetype=asm -O0 < %s | FileCheck %s
2 ; RUN: llc -mtriple=i686-w64-mingw32 -filetype=asm -O0 < %s | FileCheck %s
3 ; CHECK: .section .debug_info
4
5 ; RUN: llc -mtriple=i686-pc-win32 -filetype=asm -O0 < %s | FileCheck -check-prefix=WIN32 %s
6 ; WIN32: .section .debug$S,"rn"
7
8 ; generated from:
9 ; clang -g -S -emit-llvm test.c -o test.ll
10 ; int main()
11 ; {
12 ; return 0;
13 ; }
14
15 define i32 @main() #0 {
16 entry:
17 %retval = alloca i32, align 4
18 store i32 0, i32* %retval
19 ret i32 0, !dbg !10
20 }
21
22 attributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf"="true" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
23
24 !llvm.dbg.cu = !{!0}
25 !llvm.module.flags = !{!9, !11}
26
27 !0 = metadata !{i32 786449, metadata !1, i32 12, metadata !"clang version 3.4 ", i1 false, metadata !"", i32 0, metadata !2, metadata !2, metadata !3, metadata !2, metadata !2, metadata !""} ; [ DW_TAG_compile_unit ] [C:\Projects/test.c] [DW_LANG_C99]
28 !1 = metadata !{metadata !"test.c", metadata !"C:\5CProjects"}
29 !2 = metadata !{i32 0}
30 !3 = metadata !{metadata !4}
31 !4 = metadata !{i32 786478, metadata !1, metadata !5, metadata !"main", metadata !"main", metadata !"", i32 1, metadata !6, i1 false, i1 true, i32 0, i32 0, null, i32 0, i1 false, i32 ()* @main, null, null, metadata !2, i32 2} ; [ DW_TAG_subprogram ] [line 1] [def] [scope 2] [main]
32 !5 = metadata !{i32 786473, metadata !1} ; [ DW_TAG_file_type ] [C:\Projects/test.c]
33 !6 = metadata !{i32 786453, i32 0, null, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !7, i32 0, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
34 !7 = metadata !{metadata !8}
35 !8 = metadata !{i32 786468, null, null, metadata !"int", i32 0, i64 32, i64 32, i64 0, i32 0, i32 5} ; [ DW_TAG_base_type ] [int] [line 0, size 32, align 32, offset 0, enc DW_ATE_signed]
36 !9 = metadata !{i32 2, metadata !"Dwarf Version", i32 3}
37 !10 = metadata !{i32 3, i32 0, metadata !4, null}
38 !11 = metadata !{i32 1, metadata !"Debug Info Version", i32 1}
88 ; {
99 ; return 0;
1010 ; }
11
12 ; ModuleID = 'test.c'
13 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f80:128:128-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S32"
14 target triple = "i686-pc-win32"
1511
1612 ; Function Attrs: nounwind
1713 define i32 @main() #0 {
None ; RUN: llc -march=x86 -asm-verbose < %s | grep DW_TAG_formal_parameter
0 ; RUN: %llc_dwarf -march=x86 -asm-verbose < %s | grep DW_TAG_formal_parameter
11
22
33 %struct.Pt = type { double, double }
None ; RUN: llc -O0 < %s | FileCheck %s
0 ; RUN: %llc_dwarf -O0 < %s | FileCheck %s
11 ; Do not emit AT_upper_bound for an unbounded array.
22 ; radar 9241695
33 define i32 @main() nounwind ssp {
0 ; REQUIRES: object-emission
1 ; RUN: llc -O0 -filetype=obj -generate-dwarf-cu-ranges %s -o %t
1 ; RUN: %llc_dwarf -O0 -filetype=obj -generate-dwarf-cu-ranges %s -o %t
22 ; RUN: llvm-dwarfdump %t | FileCheck %s
33
44 ; Check that we emit ranges for this when the -generate-dwarf-cu-ranges flag is passed.
1313 ; auto pr = &A::r;
1414 ; }
1515 ;
16 ; RUN: llc -filetype=obj -O0 < %s | llvm-dwarfdump - | FileCheck %s
16 ; RUN: %llc_dwarf -filetype=obj -O0 < %s | llvm-dwarfdump - | FileCheck %s
1717 ; CHECK: DW_TAG_subroutine_type DW_CHILDREN_yes
1818 ; CHECK-NEXT: DW_AT_reference DW_FORM_flag_present
1919 ; CHECK: DW_TAG_subroutine_type DW_CHILDREN_yes
0 ; REQUIRES: object-emission
11
2 ; RUN: llc -generate-dwarf-pub-sections=Enable -filetype=obj -o %t.o < %s
2 ; RUN: %llc_dwarf -generate-dwarf-pub-sections=Enable -filetype=obj -o %t.o < %s
33 ; RUN: llvm-dwarfdump -debug-dump=pubnames %t.o | FileCheck %s
44 ; ModuleID = 'dwarf-public-names.cpp'
55 ;
0 ; REQUIRES: object-emission
11
2 ; RUN: llc -O0 -filetype=obj < %s > %t
2 ; RUN: %llc_dwarf -O0 -filetype=obj < %s > %t
33 ; RUN: llvm-dwarfdump %t | FileCheck %s
44
55 ; IR generated from the following code compiled with clang -g:
0 ; REQUIRES: object-emission
11
2 ; RUN: llc -O0 -filetype=obj < %s > %t
2 ; RUN: %llc_dwarf -O0 -filetype=obj < %s > %t
33 ; RUN: llvm-dwarfdump %t | FileCheck %s
44
55 ; generated from the following source compiled to bitcode with clang -g -O1
0 ; REQUIRES: object-emission
11
2 ; RUN: llc -filetype=obj < %s > %t
2 ; RUN: %llc_dwarf -filetype=obj < %s > %t
33 ; RUN: llvm-dwarfdump %t | FileCheck %s
44
55 ; IR generated from clang -O -g with the following source
None ; RUN: llc -O0 < %s | FileCheck %s -check-prefix ARGUMENT
1 ; RUN: llc -O0 < %s | FileCheck %s -check-prefix VARIABLE
0 ; RUN: %llc_dwarf -O0 < %s | FileCheck %s -check-prefix ARGUMENT
1 ; RUN: %llc_dwarf -O0 < %s | FileCheck %s -check-prefix VARIABLE
22 ; PR 13202
33
44 define i32 @main() uwtable {
0 ; REQUIRES: object-emission
11
2 ; RUN: llc -filetype=obj -O0 < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
2 ; RUN: %llc_dwarf -filetype=obj -O0 < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
33
44 ; generated by clang from:
55 ; struct foo {
0 ; REQUIRES: object-emission
11 ; XFAIL: hexagon
22
3 ; RUN: llc -filetype=obj -O0 < %s > %t
3 ; RUN: %llc_dwarf -filetype=obj -O0 < %s > %t
44 ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
55 ; CHECK: DW_TAG_ptr_to_member_type
66 ; CHECK: DW_TAG_ptr_to_member_type
0 ; REQUIRES: object-emission
11
2 ; RUN: llc -O0 -filetype=obj < %s > %t
2 ; RUN: %llc_dwarf -O0 -filetype=obj < %s > %t
33 ; RUN: llvm-dwarfdump %t | FileCheck %s
44 ; CHECK: debug_info contents
55 ; CHECK: [[NS1:0x[0-9a-f]*]]:{{ *}}DW_TAG_namespace
0 ; REQUIRES: object-emission
11
2 ; RUN: llc -O0 -filetype=obj < %s > %t
2 ; RUN: %llc_dwarf -O0 -filetype=obj < %s > %t
33 ; RUN: llvm-dwarfdump %t | FileCheck %s
44
55 ; This was pulled from clang's debug-info-template-recursive.cpp test.
0 ; REQUIRES: object-emission
11
2 ; RUN: llc -filetype=obj -O0 < %s > %t
2 ; RUN: %llc_dwarf -filetype=obj -O0 < %s > %t
33 ; RUN: llvm-dwarfdump -debug-dump=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.
0 ; REQUIRES: object-emission
11
2 ; RUN: llc -filetype=obj -O0 < %s > %t
2 ; RUN: %llc_dwarf -filetype=obj -O0 < %s > %t
33 ; RUN: llvm-dwarfdump -debug-dump=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]+]]})
44
55 ; REQUIRES: object-emission
66
7 ; RUN: llc %s -o %t -filetype=obj -O0
7 ; RUN: %llc_dwarf %s -o %t -filetype=obj -O0
88 ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
99
1010 ; ModuleID = 'test.bc'
0 ; REQUIRES: object-emission
11
2 ; RUN: llc -O0 -filetype=obj < %s > %t
2 ; RUN: %llc_dwarf -O0 -filetype=obj < %s > %t
33 ; RUN: llvm-dwarfdump %t | FileCheck %s
44
55 ; Make sure we are generating DWARF version 3 when module flag says so.
11
22 ; RUN: llvm-link %s %p/type-unique-simple-b.ll -S -o %t
33 ; RUN: cat %t | FileCheck %s -check-prefix=LINK
4 ; RUN: llc -filetype=obj -O0 < %t > %t2
4 ; RUN: %llc_dwarf -filetype=obj -O0 < %t > %t2
55 ; RUN: llvm-dwarfdump -debug-dump=info %t2 | FileCheck %s
66
77 ; Make sure the backend generates a single DIE and uses ref_addr.
0 ; REQUIRES: object-emission
11 ;
2 ; RUN: llvm-link %s %p/type-unique-simple2-b.ll -S -o - | llc -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-dump=info - | FileCheck %s
33 ;
44 ; Tests for a merge error where attributes are inserted twice into the same DIE.
55 ;
11
22 ; RUN: llvm-link %S/Inputs/type-unique-simple2-a.ll %S/Inputs/type-unique-simple2-b.ll -S -o %t
33 ; RUN: cat %t | FileCheck %S/Inputs/type-unique-simple2-a.ll -check-prefix=LINK
4 ; RUN: llc -filetype=obj -O0 < %t > %t2
4 ; RUN: %llc_dwarf -filetype=obj -O0 < %t > %t2
55 ; RUN: llvm-dwarfdump -debug-dump=info %t2 | FileCheck %S/Inputs/type-unique-simple2-a.ll
154154 if re.search(r'cygwin|mingw32|win32', config.host_triple):
155155 lli_mcjit += ' -mtriple='+config.host_triple+'-elf'
156156 config.substitutions.append( ('%lli_mcjit', lli_mcjit) )
157
158 # Similarly, have a macro to use llc with DWARF even when the host is win32.
159 llc_dwarf = 'llc'
160 if re.search(r'win32', config.target_triple):
161 llc_dwarf += ' -mtriple='+config.target_triple.replace('-win32', '-mingw32')
162 config.substitutions.append( ('%llc_dwarf', llc_dwarf) )
157163
158164 # Provide a substition for those tests that need to run the jit to obtain data
159165 # but simply want use the currently considered most reliable jit for platform