Macro debug info support in LLVM IR
Introduced DIMacro and DIMacroFile debug info metadata in the LLVM IR to support macros. Differential Revision: http://reviews.llvm.org/D14687 llvm-svn: 255245
This commit is contained in:
@@ -1312,10 +1312,12 @@ TEST_F(DICompileUnitTest, get) {
|
||||
MDTuple *GlobalVariables = getTuple();
|
||||
MDTuple *ImportedEntities = getTuple();
|
||||
uint64_t DWOId = 0x10000000c0ffee;
|
||||
MDTuple *Macros = getTuple();
|
||||
auto *N = DICompileUnit::getDistinct(
|
||||
Context, SourceLanguage, File, Producer, IsOptimized, Flags,
|
||||
RuntimeVersion, SplitDebugFilename, EmissionKind, EnumTypes,
|
||||
RetainedTypes, Subprograms, GlobalVariables, ImportedEntities, DWOId);
|
||||
RetainedTypes, Subprograms, GlobalVariables, ImportedEntities, Macros,
|
||||
DWOId);
|
||||
|
||||
EXPECT_EQ(dwarf::DW_TAG_compile_unit, N->getTag());
|
||||
EXPECT_EQ(SourceLanguage, N->getSourceLanguage());
|
||||
@@ -1331,6 +1333,7 @@ TEST_F(DICompileUnitTest, get) {
|
||||
EXPECT_EQ(Subprograms, N->getSubprograms().get());
|
||||
EXPECT_EQ(GlobalVariables, N->getGlobalVariables().get());
|
||||
EXPECT_EQ(ImportedEntities, N->getImportedEntities().get());
|
||||
EXPECT_EQ(Macros, N->getMacros().get());
|
||||
EXPECT_EQ(DWOId, N->getDWOId());
|
||||
|
||||
TempDICompileUnit Temp = N->clone();
|
||||
@@ -1348,6 +1351,7 @@ TEST_F(DICompileUnitTest, get) {
|
||||
EXPECT_EQ(Subprograms, Temp->getSubprograms().get());
|
||||
EXPECT_EQ(GlobalVariables, Temp->getGlobalVariables().get());
|
||||
EXPECT_EQ(ImportedEntities, Temp->getImportedEntities().get());
|
||||
EXPECT_EQ(Macros, Temp->getMacros().get());
|
||||
EXPECT_EQ(DWOId, Temp->getDWOId());
|
||||
|
||||
auto *TempAddress = Temp.get();
|
||||
@@ -1372,7 +1376,7 @@ TEST_F(DICompileUnitTest, replaceArrays) {
|
||||
auto *N = DICompileUnit::getDistinct(
|
||||
Context, SourceLanguage, File, Producer, IsOptimized, Flags,
|
||||
RuntimeVersion, SplitDebugFilename, EmissionKind, EnumTypes,
|
||||
RetainedTypes, nullptr, nullptr, ImportedEntities, DWOId);
|
||||
RetainedTypes, nullptr, nullptr, ImportedEntities, nullptr, DWOId);
|
||||
|
||||
auto *Subprograms = MDTuple::getDistinct(Context, None);
|
||||
EXPECT_EQ(nullptr, N->getSubprograms().get());
|
||||
@@ -1387,6 +1391,13 @@ TEST_F(DICompileUnitTest, replaceArrays) {
|
||||
EXPECT_EQ(GlobalVariables, N->getGlobalVariables().get());
|
||||
N->replaceGlobalVariables(nullptr);
|
||||
EXPECT_EQ(nullptr, N->getGlobalVariables().get());
|
||||
|
||||
auto *Macros = MDTuple::getDistinct(Context, None);
|
||||
EXPECT_EQ(nullptr, N->getMacros().get());
|
||||
N->replaceMacros(Macros);
|
||||
EXPECT_EQ(Macros, N->getMacros().get());
|
||||
N->replaceMacros(nullptr);
|
||||
EXPECT_EQ(nullptr, N->getMacros().get());
|
||||
}
|
||||
|
||||
typedef MetadataTest DISubprogramTest;
|
||||
|
||||
Reference in New Issue
Block a user