summaryrefslogtreecommitdiff
path: root/unittests
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2016-06-01 01:17:57 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2016-06-01 01:17:57 +0000
commitd8d85ac3c91f057a694a9f0630c565102e60bd2d (patch)
tree47ab2ac5b008d643b804f10fc7a86758192fe215 /unittests
parented2188ea1797e342fa8f4fbc23f2851ab8e4dad0 (diff)
IR: Allow multiple global metadata attachments with the same type.
This will be necessary to allow the global merge pass to attach multiple debug info metadata nodes to global variables once we reverse the edge from DIGlobalVariable to GlobalVariable. Differential Revision: http://reviews.llvm.org/D20414 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271358 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r--unittests/IR/MetadataTest.cpp26
1 files changed, 0 insertions, 26 deletions
diff --git a/unittests/IR/MetadataTest.cpp b/unittests/IR/MetadataTest.cpp
index d14743dad70..a36e131b4bc 100644
--- a/unittests/IR/MetadataTest.cpp
+++ b/unittests/IR/MetadataTest.cpp
@@ -2242,32 +2242,6 @@ TEST_F(FunctionAttachmentTest, getAll) {
EXPECT_EQ(T2, MDs[3].second);
}
-TEST_F(FunctionAttachmentTest, dropUnknownMetadata) {
- Function *F = getFunction("foo");
-
- MDTuple *T1 = getTuple();
- MDTuple *T2 = getTuple();
- MDTuple *P = getTuple();
- DISubprogram *SP = getSubprogram();
-
- F->setMetadata("other1", T1);
- F->setMetadata(LLVMContext::MD_dbg, SP);
- F->setMetadata("other2", T2);
- F->setMetadata(LLVMContext::MD_prof, P);
-
- unsigned Known[] = {Context.getMDKindID("other2"), LLVMContext::MD_prof};
- F->dropUnknownMetadata(Known);
-
- EXPECT_EQ(T2, F->getMetadata("other2"));
- EXPECT_EQ(P, F->getMetadata(LLVMContext::MD_prof));
- EXPECT_EQ(nullptr, F->getMetadata("other1"));
- EXPECT_EQ(nullptr, F->getMetadata(LLVMContext::MD_dbg));
-
- F->setMetadata("other2", nullptr);
- F->setMetadata(LLVMContext::MD_prof, nullptr);
- EXPECT_FALSE(F->hasMetadata());
-}
-
TEST_F(FunctionAttachmentTest, Verifier) {
Function *F = getFunction("foo");
F->setMetadata("attach", getTuple());