summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Transforms/Utils/ValueMapperTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/unittests/Transforms/Utils/ValueMapperTest.cpp')
-rw-r--r--llvm/unittests/Transforms/Utils/ValueMapperTest.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/unittests/Transforms/Utils/ValueMapperTest.cpp b/llvm/unittests/Transforms/Utils/ValueMapperTest.cpp
index 56e407b9e6b..b9cca2292c1 100644
--- a/llvm/unittests/Transforms/Utils/ValueMapperTest.cpp
+++ b/llvm/unittests/Transforms/Utils/ValueMapperTest.cpp
@@ -209,4 +209,16 @@ TEST(ValueMapperTest, MapValueLocalAsMetadata) {
EXPECT_EQ(&A, MapValue(MAV, VM, RF_IgnoreMissingLocals));
}
+TEST(ValueMapperTest, MapMetadataNullMapGlobalWithIgnoreMissingLocals) {
+ LLVMContext C;
+ FunctionType *FTy =
+ FunctionType::get(Type::getVoidTy(C), Type::getInt8Ty(C), false);
+ std::unique_ptr<Function> F(
+ Function::Create(FTy, GlobalValue::ExternalLinkage, "F"));
+
+ ValueToValueMapTy VM;
+ RemapFlags Flags = RF_IgnoreMissingLocals | RF_NullMapMissingGlobalValues;
+ EXPECT_EQ(nullptr, MapValue(F.get(), VM, Flags));
+}
+
} // end namespace
OpenPOWER on IntegriCloud