summaryrefslogtreecommitdiff
path: root/gnu/llvm/unittests/ADT/MapVectorTest.cpp
diff options
context:
space:
mode:
authorPatrick Wildt <patrick@cvs.openbsd.org>2017-01-24 08:33:39 +0000
committerPatrick Wildt <patrick@cvs.openbsd.org>2017-01-24 08:33:39 +0000
commit191f5aec14fa2cfaf2f023580df9ac81db321223 (patch)
tree54650dd8fc4a937b4efa5c479f29f9bd9f218975 /gnu/llvm/unittests/ADT/MapVectorTest.cpp
parentc5c5d71a3c51a145ba9d0a7d2f3ca2be4d6a2131 (diff)
Import LLVM 4.0.0 rc1 including clang and lld to help the current
development effort on OpenBSD/arm64.
Diffstat (limited to 'gnu/llvm/unittests/ADT/MapVectorTest.cpp')
-rw-r--r--gnu/llvm/unittests/ADT/MapVectorTest.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/gnu/llvm/unittests/ADT/MapVectorTest.cpp b/gnu/llvm/unittests/ADT/MapVectorTest.cpp
index ff8464293c7..f5b094fb627 100644
--- a/gnu/llvm/unittests/ADT/MapVectorTest.cpp
+++ b/gnu/llvm/unittests/ADT/MapVectorTest.cpp
@@ -148,6 +148,15 @@ TEST(MapVectorTest, iteration_test) {
}
}
+TEST(MapVectorTest, NonCopyable) {
+ MapVector<int, std::unique_ptr<int>> MV;
+ MV.insert(std::make_pair(1, llvm::make_unique<int>(1)));
+ MV.insert(std::make_pair(2, llvm::make_unique<int>(2)));
+
+ ASSERT_EQ(MV.count(1), 1u);
+ ASSERT_EQ(*MV.find(2)->second, 2);
+}
+
TEST(SmallMapVectorSmallTest, insert_pop) {
SmallMapVector<int, int, 32> MV;
std::pair<SmallMapVector<int, int, 32>::iterator, bool> R;
@@ -257,6 +266,15 @@ TEST(SmallMapVectorSmallTest, iteration_test) {
}
}
+TEST(SmallMapVectorSmallTest, NonCopyable) {
+ SmallMapVector<int, std::unique_ptr<int>, 8> MV;
+ MV.insert(std::make_pair(1, llvm::make_unique<int>(1)));
+ MV.insert(std::make_pair(2, llvm::make_unique<int>(2)));
+
+ ASSERT_EQ(MV.count(1), 1u);
+ ASSERT_EQ(*MV.find(2)->second, 2);
+}
+
TEST(SmallMapVectorLargeTest, insert_pop) {
SmallMapVector<int, int, 1> MV;
std::pair<SmallMapVector<int, int, 1>::iterator, bool> R;