aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/IR/MetadataTest.cpp
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2015-12-07 15:05:44 +0000
committerTeresa Johnson <tejohnson@google.com>2015-12-07 15:05:44 +0000
commitd98152b6d702ebd60a872d3587abfd4dda5bf730 (patch)
treecc13377fcf28e387b4ccb73449a99a24d6199cfd /llvm/unittests/IR/MetadataTest.cpp
parent291fe0159f1869619718b33b7ac6435935d9d63b (diff)
downloadllvm-d98152b6d702ebd60a872d3587abfd4dda5bf730.zip
llvm-d98152b6d702ebd60a872d3587abfd4dda5bf730.tar.gz
llvm-d98152b6d702ebd60a872d3587abfd4dda5bf730.tar.bz2
[ThinLTO] Support cloning of temporary DILocation metadata
This is needed to support linking of module-level metadata as a postpass after function importing, where we will be leaving temporary metadata on imported instructions until the postpass metadata import. Also added unittest. Split from D14838. llvm-svn: 254914
Diffstat (limited to 'llvm/unittests/IR/MetadataTest.cpp')
-rw-r--r--llvm/unittests/IR/MetadataTest.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/unittests/IR/MetadataTest.cpp b/llvm/unittests/IR/MetadataTest.cpp
index da4271a..8f346f5 100644
--- a/llvm/unittests/IR/MetadataTest.cpp
+++ b/llvm/unittests/IR/MetadataTest.cpp
@@ -813,6 +813,14 @@ TEST_F(DILocationTest, getTemporary) {
EXPECT_FALSE(L->isResolved());
}
+TEST_F(DILocationTest, cloneTemporary) {
+ MDNode *N = MDNode::get(Context, None);
+ auto L = DILocation::getTemporary(Context, 2, 7, N);
+ EXPECT_TRUE(L->isTemporary());
+ auto L2 = L->clone();
+ EXPECT_TRUE(L2->isTemporary());
+}
+
typedef MetadataTest GenericDINodeTest;
TEST_F(GenericDINodeTest, get) {