[yaml2obj/obj2yaml] - Add support for .stack_sizes sections.
[llvm-complete.git] / unittests / ADT / SetVectorTest.cpp
blobb9fef78d2fdb3f56fcf1d76e56b54a0e62fcea30
1 //===- llvm/unittest/ADT/SetVector.cpp ------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // SetVector unit tests.
11 //===----------------------------------------------------------------------===//
13 #include "llvm/ADT/SetVector.h"
14 #include "gtest/gtest.h"
16 using namespace llvm;
18 TEST(SetVector, EraseTest) {
19 SetVector<int> S;
20 S.insert(0);
21 S.insert(1);
22 S.insert(2);
24 auto I = S.erase(std::next(S.begin()));
26 // Test that the returned iterator is the expected one-after-erase
27 // and the size/contents is the expected sequence {0, 2}.
28 EXPECT_EQ(std::next(S.begin()), I);
29 EXPECT_EQ(2u, S.size());
30 EXPECT_EQ(0, *S.begin());
31 EXPECT_EQ(2, *std::next(S.begin()));