[PowerPC] Optimize compares fed by ANDISo
[llvm-core.git] / unittests / ADT / SetVectorTest.cpp
blobb8cac0dc311e50da9166457c743319289135caa4
1 //===- llvm/unittest/ADT/SetVector.cpp ------------------------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // SetVector unit tests.
12 //===----------------------------------------------------------------------===//
14 #include "llvm/ADT/SetVector.h"
15 #include "gtest/gtest.h"
17 using namespace llvm;
19 TEST(SetVector, EraseTest) {
20 SetVector<int> S;
21 S.insert(0);
22 S.insert(1);
23 S.insert(2);
25 auto I = S.erase(std::next(S.begin()));
27 // Test that the returned iterator is the expected one-after-erase
28 // and the size/contents is the expected sequence {0, 2}.
29 EXPECT_EQ(std::next(S.begin()), I);
30 EXPECT_EQ(2u, S.size());
31 EXPECT_EQ(0, *S.begin());
32 EXPECT_EQ(2, *std::next(S.begin()));