diff options
author | Patrick Wildt <patrick@cvs.openbsd.org> | 2017-01-24 08:33:39 +0000 |
---|---|---|
committer | Patrick Wildt <patrick@cvs.openbsd.org> | 2017-01-24 08:33:39 +0000 |
commit | 191f5aec14fa2cfaf2f023580df9ac81db321223 (patch) | |
tree | 54650dd8fc4a937b4efa5c479f29f9bd9f218975 /gnu/llvm/unittests/ADT/MapVectorTest.cpp | |
parent | c5c5d71a3c51a145ba9d0a7d2f3ca2be4d6a2131 (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.cpp | 18 |
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; |