summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/IR
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/unittests/IR')
-rw-r--r--llvm/unittests/IR/IRBuilderTest.cpp11
-rw-r--r--llvm/unittests/IR/MetadataTest.cpp24
2 files changed, 21 insertions, 14 deletions
diff --git a/llvm/unittests/IR/IRBuilderTest.cpp b/llvm/unittests/IR/IRBuilderTest.cpp
index 186330f1057..d361107cc0d 100644
--- a/llvm/unittests/IR/IRBuilderTest.cpp
+++ b/llvm/unittests/IR/IRBuilderTest.cpp
@@ -463,13 +463,14 @@ TEST_F(IRBuilderTest, DebugLoc) {
TEST_F(IRBuilderTest, DIImportedEntity) {
IRBuilder<> Builder(BB);
DIBuilder DIB(*M);
+ auto F = DIB.createFile("F.CBL", "/");
auto CU = DIB.createCompileUnit(dwarf::DW_LANG_Cobol74,
- DIB.createFile("F.CBL", "/"), "llvm-cobol74",
+ F, "llvm-cobol74",
true, "", 0);
- DIB.createImportedDeclaration(CU, nullptr, 1);
- DIB.createImportedDeclaration(CU, nullptr, 1);
- DIB.createImportedModule(CU, (DIImportedEntity *)nullptr, 2);
- DIB.createImportedModule(CU, (DIImportedEntity *)nullptr, 2);
+ DIB.createImportedDeclaration(CU, nullptr, F, 1);
+ DIB.createImportedDeclaration(CU, nullptr, F, 1);
+ DIB.createImportedModule(CU, (DIImportedEntity *)nullptr, F, 2);
+ DIB.createImportedModule(CU, (DIImportedEntity *)nullptr, F, 2);
DIB.finalize();
EXPECT_TRUE(verifyModule(*M));
EXPECT_TRUE(CU->getImportedEntities().size() == 2);
diff --git a/llvm/unittests/IR/MetadataTest.cpp b/llvm/unittests/IR/MetadataTest.cpp
index cb38b30f43e..e47afca532d 100644
--- a/llvm/unittests/IR/MetadataTest.cpp
+++ b/llvm/unittests/IR/MetadataTest.cpp
@@ -2116,29 +2116,35 @@ TEST_F(DIImportedEntityTest, get) {
unsigned Tag = dwarf::DW_TAG_imported_module;
DIScope *Scope = getSubprogram();
DINode *Entity = getCompositeType();
+ DIFile *File = getFile();
unsigned Line = 5;
StringRef Name = "name";
- auto *N = DIImportedEntity::get(Context, Tag, Scope, Entity, Line, Name);
+ auto *N =
+ DIImportedEntity::get(Context, Tag, Scope, Entity, File, Line, Name);
EXPECT_EQ(Tag, N->getTag());
EXPECT_EQ(Scope, N->getScope());
EXPECT_EQ(Entity, N->getEntity());
+ EXPECT_EQ(File, N->getFile());
EXPECT_EQ(Line, N->getLine());
EXPECT_EQ(Name, N->getName());
- EXPECT_EQ(N, DIImportedEntity::get(Context, Tag, Scope, Entity, Line, Name));
+ EXPECT_EQ(
+ N, DIImportedEntity::get(Context, Tag, Scope, Entity, File, Line, Name));
EXPECT_NE(N,
DIImportedEntity::get(Context, dwarf::DW_TAG_imported_declaration,
- Scope, Entity, Line, Name));
+ Scope, Entity, File, Line, Name));
EXPECT_NE(N, DIImportedEntity::get(Context, Tag, getSubprogram(), Entity,
- Line, Name));
+ File, Line, Name));
EXPECT_NE(N, DIImportedEntity::get(Context, Tag, Scope, getCompositeType(),
- Line, Name));
- EXPECT_NE(N,
- DIImportedEntity::get(Context, Tag, Scope, Entity, Line + 1, Name));
- EXPECT_NE(N,
- DIImportedEntity::get(Context, Tag, Scope, Entity, Line, "other"));
+ File, Line, Name));
+ EXPECT_NE(N, DIImportedEntity::get(Context, Tag, Scope, Entity, nullptr, Line,
+ Name));
+ EXPECT_NE(N, DIImportedEntity::get(Context, Tag, Scope, Entity, File,
+ Line + 1, Name));
+ EXPECT_NE(N, DIImportedEntity::get(Context, Tag, Scope, Entity, File, Line,
+ "other"));
TempDIImportedEntity Temp = N->clone();
EXPECT_EQ(N, MDNode::replaceWithUniqued(std::move(Temp)));
OpenPOWER on IntegriCloud