summaryrefslogtreecommitdiff
path: root/unittests/IR/IRBuilderTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'unittests/IR/IRBuilderTest.cpp')
-rw-r--r--unittests/IR/IRBuilderTest.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/unittests/IR/IRBuilderTest.cpp b/unittests/IR/IRBuilderTest.cpp
index bd0eae0399a44..58fd71b8a3574 100644
--- a/unittests/IR/IRBuilderTest.cpp
+++ b/unittests/IR/IRBuilderTest.cpp
@@ -252,7 +252,7 @@ TEST_F(IRBuilderTest, FastMathFlags) {
}
TEST_F(IRBuilderTest, WrapFlags) {
- IRBuilder<true, NoFolder> Builder(BB);
+ IRBuilder<NoFolder> Builder(BB);
// Test instructions.
GlobalVariable *G = new GlobalVariable(*M, Builder.getInt32Ty(), true,
@@ -418,4 +418,18 @@ TEST_F(IRBuilderTest, DebugLoc) {
DIB.finalize();
}
+
+TEST_F(IRBuilderTest, DIImportedEntity) {
+ IRBuilder<> Builder(BB);
+ DIBuilder DIB(*M);
+ auto CU = DIB.createCompileUnit(dwarf::DW_LANG_Cobol74, "F.CBL", "/",
+ "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.finalize();
+ EXPECT_TRUE(verifyModule(*M));
+ EXPECT_TRUE(CU->getImportedEntities().size() == 2);
+}
}