140dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth//===- llvm/unittest/ADT/TinyPtrVectorTest.cpp ----------------------------===//
240dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth//
340dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth//                     The LLVM Compiler Infrastructure
440dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth//
540dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth// This file is distributed under the University of Illinois Open Source
640dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth// License. See LICENSE.TXT for details.
740dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth//
840dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth//===----------------------------------------------------------------------===//
940dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth//
1040dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth// TinyPtrVector unit tests.
1140dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth//
1240dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth//===----------------------------------------------------------------------===//
1340dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth
145a88dda4be791426ab4d20a6a6c9c65d66614a27Chandler Carruth#include "llvm/ADT/TinyPtrVector.h"
1540dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth#include "llvm/ADT/ArrayRef.h"
1640dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth#include "llvm/ADT/STLExtras.h"
175a88dda4be791426ab4d20a6a6c9c65d66614a27Chandler Carruth#include "llvm/ADT/SmallVector.h"
1840dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth#include "llvm/Support/type_traits.h"
195a88dda4be791426ab4d20a6a6c9c65d66614a27Chandler Carruth#include "gtest/gtest.h"
2040dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth#include <algorithm>
2140dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth#include <list>
2240dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth#include <vector>
2340dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth
2440dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruthusing namespace llvm;
2540dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth
2640dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruthnamespace {
2740dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth
2840dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth// The world's worst RNG, but it is deterministic and makes it easy to get
2940dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth// *some* shuffling of elements.
3040dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruthstatic ptrdiff_t test_shuffle_rng(ptrdiff_t i) {
3140dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  return (i + i * 33) % i;
3240dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth}
3340dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruthstatic ptrdiff_t (*test_shuffle_rng_p)(ptrdiff_t) = &test_shuffle_rng;
3440dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth
3540dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruthtemplate <typename VectorT>
3640dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruthclass TinyPtrVectorTest : public testing::Test {
3740dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruthprotected:
3840dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  typedef typename VectorT::value_type PtrT;
3936b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines  typedef typename std::remove_pointer<PtrT>::type ValueT;
4040dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth
4140dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  VectorT V;
4240dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  VectorT V2;
4340dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth
4440dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  ValueT TestValues[1024];
4540dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  std::vector<PtrT> TestPtrs;
4640dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth
4740dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  TinyPtrVectorTest() {
4840dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth    for (size_t i = 0, e = array_lengthof(TestValues); i != e; ++i)
4940dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth      TestPtrs.push_back(&TestValues[i]);
5040dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth
5140dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth    std::random_shuffle(TestPtrs.begin(), TestPtrs.end(), test_shuffle_rng_p);
5240dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  }
5340dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth
5440dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  ArrayRef<PtrT> testArray(size_t N) {
5540dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth    return makeArrayRef(&TestPtrs[0], N);
5640dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  }
5740dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth
5840dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  void appendValues(VectorT &V, ArrayRef<PtrT> Values) {
5940dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth    for (size_t i = 0, e = Values.size(); i != e; ++i)
6040dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth      V.push_back(Values[i]);
6140dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  }
6240dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth
6306bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  void setVectors(ArrayRef<PtrT> Values1, ArrayRef<PtrT> Values2) {
6406bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth    V.clear();
6506bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth    appendValues(V, Values1);
6606bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth    V2.clear();
6706bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth    appendValues(V2, Values2);
6806bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  }
6906bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth
7040dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  void expectValues(const VectorT &V, ArrayRef<PtrT> Values) {
7140dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth    EXPECT_EQ(Values.empty(), V.empty());
7240dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth    EXPECT_EQ(Values.size(), V.size());
7340dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth    for (size_t i = 0, e = Values.size(); i != e; ++i) {
7440dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth      EXPECT_EQ(Values[i], V[i]);
7536b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines      EXPECT_EQ(Values[i], *std::next(V.begin(), i));
7640dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth    }
7736b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines    EXPECT_EQ(V.end(), std::next(V.begin(), Values.size()));
7840dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  }
7940dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth};
8040dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth
8140dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruthtypedef ::testing::Types<TinyPtrVector<int*>,
8240dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth                         TinyPtrVector<double*>
8340dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth                         > TinyPtrVectorTestTypes;
8440dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler CarruthTYPED_TEST_CASE(TinyPtrVectorTest, TinyPtrVectorTestTypes);
8540dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth
8640dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler CarruthTYPED_TEST(TinyPtrVectorTest, EmptyTest) {
8740dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->expectValues(this->V, this->testArray(0));
8840dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth}
8940dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth
9040dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler CarruthTYPED_TEST(TinyPtrVectorTest, PushPopBack) {
9140dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->V.push_back(this->TestPtrs[0]);
9240dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->expectValues(this->V, this->testArray(1));
9340dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->V.push_back(this->TestPtrs[1]);
9440dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->expectValues(this->V, this->testArray(2));
9540dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->V.push_back(this->TestPtrs[2]);
9640dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->expectValues(this->V, this->testArray(3));
9740dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->V.push_back(this->TestPtrs[3]);
9840dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->expectValues(this->V, this->testArray(4));
9940dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->V.push_back(this->TestPtrs[4]);
10040dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->expectValues(this->V, this->testArray(5));
10140dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth
10240dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  // Pop and clobber a few values to keep things interesting.
10340dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->V.pop_back();
10440dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->expectValues(this->V, this->testArray(4));
10540dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->V.pop_back();
10640dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->expectValues(this->V, this->testArray(3));
10740dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->TestPtrs[3] = &this->TestValues[42];
10840dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->TestPtrs[4] = &this->TestValues[43];
10940dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->V.push_back(this->TestPtrs[3]);
11040dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->expectValues(this->V, this->testArray(4));
11140dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->V.push_back(this->TestPtrs[4]);
11240dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->expectValues(this->V, this->testArray(5));
11340dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth
11440dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->V.pop_back();
11540dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->expectValues(this->V, this->testArray(4));
11640dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->V.pop_back();
11740dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->expectValues(this->V, this->testArray(3));
11840dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->V.pop_back();
11940dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->expectValues(this->V, this->testArray(2));
12040dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->V.pop_back();
12140dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->expectValues(this->V, this->testArray(1));
12240dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->V.pop_back();
12340dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->expectValues(this->V, this->testArray(0));
12440dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth
12540dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->appendValues(this->V, this->testArray(42));
12640dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->expectValues(this->V, this->testArray(42));
12740dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth}
12840dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth
12940dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler CarruthTYPED_TEST(TinyPtrVectorTest, ClearTest) {
13040dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->expectValues(this->V, this->testArray(0));
13140dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->V.clear();
13240dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->expectValues(this->V, this->testArray(0));
13340dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth
13440dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->appendValues(this->V, this->testArray(1));
13540dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->expectValues(this->V, this->testArray(1));
13640dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->V.clear();
13740dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->expectValues(this->V, this->testArray(0));
13840dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth
13940dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->appendValues(this->V, this->testArray(42));
14040dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->expectValues(this->V, this->testArray(42));
14140dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->V.clear();
14240dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->expectValues(this->V, this->testArray(0));
14340dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth}
14440dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth
14540dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler CarruthTYPED_TEST(TinyPtrVectorTest, CopyAndMoveCtorTest) {
14640dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->appendValues(this->V, this->testArray(42));
14740dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  TypeParam Copy(this->V);
14840dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->expectValues(Copy, this->testArray(42));
14940dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth
15040dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  // This is a separate copy, and so it shouldn't destroy the original.
15140dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  Copy.clear();
15240dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->expectValues(Copy, this->testArray(0));
15340dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->expectValues(this->V, this->testArray(42));
15440dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth
15540dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  TypeParam Copy2(this->V2);
15640dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->appendValues(Copy2, this->testArray(42));
15740dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->expectValues(Copy2, this->testArray(42));
15840dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->expectValues(this->V2, this->testArray(0));
15940dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth
16040dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  TypeParam Move(std::move(Copy2));
16140dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->expectValues(Move, this->testArray(42));
16240dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->expectValues(Copy2, this->testArray(0));
16340dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth}
16440dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth
16506bd8ca8c276d9bc20b192188224e1e5215666a0Chandler CarruthTYPED_TEST(TinyPtrVectorTest, CopyAndMoveTest) {
16606bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->V = this->V2;
16706bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->expectValues(this->V, this->testArray(0));
16806bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->expectValues(this->V2, this->testArray(0));
16906bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->V = std::move(this->V2);
17006bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->expectValues(this->V, this->testArray(0));
17106bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth
17206bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->setVectors(this->testArray(1), this->testArray(0));
17306bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->V = this->V2;
17406bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->expectValues(this->V, this->testArray(0));
17506bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->expectValues(this->V2, this->testArray(0));
17606bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->setVectors(this->testArray(1), this->testArray(0));
17706bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->V = std::move(this->V2);
17806bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->expectValues(this->V, this->testArray(0));
17906bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth
18006bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->setVectors(this->testArray(2), this->testArray(0));
18106bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->V = this->V2;
18206bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->expectValues(this->V, this->testArray(0));
18306bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->expectValues(this->V2, this->testArray(0));
18406bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->setVectors(this->testArray(2), this->testArray(0));
18506bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->V = std::move(this->V2);
18606bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->expectValues(this->V, this->testArray(0));
18706bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth
18806bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->setVectors(this->testArray(42), this->testArray(0));
18906bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->V = this->V2;
19006bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->expectValues(this->V, this->testArray(0));
19106bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->expectValues(this->V2, this->testArray(0));
19206bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->setVectors(this->testArray(42), this->testArray(0));
19306bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->V = std::move(this->V2);
19406bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->expectValues(this->V, this->testArray(0));
19506bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth
19606bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->setVectors(this->testArray(0), this->testArray(1));
19706bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->V = this->V2;
19806bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->expectValues(this->V, this->testArray(1));
19906bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->expectValues(this->V2, this->testArray(1));
20006bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->setVectors(this->testArray(0), this->testArray(1));
20106bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->V = std::move(this->V2);
20206bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->expectValues(this->V, this->testArray(1));
20306bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth
20406bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->setVectors(this->testArray(0), this->testArray(2));
20506bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->V = this->V2;
20606bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->expectValues(this->V, this->testArray(2));
20706bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->expectValues(this->V2, this->testArray(2));
20806bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->setVectors(this->testArray(0), this->testArray(2));
20906bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->V = std::move(this->V2);
21006bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->expectValues(this->V, this->testArray(2));
21106bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth
21206bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->setVectors(this->testArray(0), this->testArray(42));
21306bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->V = this->V2;
21406bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->expectValues(this->V, this->testArray(42));
21506bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->expectValues(this->V2, this->testArray(42));
21606bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->setVectors(this->testArray(0), this->testArray(42));
21706bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->V = std::move(this->V2);
21806bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->expectValues(this->V, this->testArray(42));
21906bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth
22006bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->setVectors(this->testArray(1), this->testArray(1));
22106bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->V = this->V2;
22206bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->expectValues(this->V, this->testArray(1));
22306bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->expectValues(this->V2, this->testArray(1));
22406bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->V = std::move(this->V2);
22506bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->expectValues(this->V, this->testArray(1));
22606bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth
22706bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->setVectors(this->testArray(1), this->testArray(2));
22806bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->V = this->V2;
22906bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->expectValues(this->V, this->testArray(2));
23006bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->expectValues(this->V2, this->testArray(2));
23106bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->setVectors(this->testArray(1), this->testArray(2));
23206bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->V = std::move(this->V2);
23306bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->expectValues(this->V, this->testArray(2));
23406bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth
23506bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->setVectors(this->testArray(1), this->testArray(42));
23606bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->V = this->V2;
23706bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->expectValues(this->V, this->testArray(42));
23806bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->expectValues(this->V2, this->testArray(42));
23906bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->setVectors(this->testArray(1), this->testArray(42));
24006bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->V = std::move(this->V2);
24106bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->expectValues(this->V, this->testArray(42));
24206bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth
24306bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->setVectors(this->testArray(2), this->testArray(1));
24406bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->V = this->V2;
24506bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->expectValues(this->V, this->testArray(1));
24606bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->expectValues(this->V2, this->testArray(1));
24706bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->setVectors(this->testArray(2), this->testArray(1));
24806bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->V = std::move(this->V2);
24906bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->expectValues(this->V, this->testArray(1));
25006bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth
25106bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->setVectors(this->testArray(2), this->testArray(2));
25206bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->V = this->V2;
25306bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->expectValues(this->V, this->testArray(2));
25406bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->expectValues(this->V2, this->testArray(2));
25506bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->setVectors(this->testArray(2), this->testArray(2));
25606bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->V = std::move(this->V2);
25706bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->expectValues(this->V, this->testArray(2));
25806bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth
25906bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->setVectors(this->testArray(2), this->testArray(42));
26006bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->V = this->V2;
26106bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->expectValues(this->V, this->testArray(42));
26206bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->expectValues(this->V2, this->testArray(42));
26306bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->setVectors(this->testArray(2), this->testArray(42));
26406bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->V = std::move(this->V2);
26506bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->expectValues(this->V, this->testArray(42));
26606bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth
26706bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->setVectors(this->testArray(42), this->testArray(1));
26806bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->V = this->V2;
26906bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->expectValues(this->V, this->testArray(1));
27006bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->expectValues(this->V2, this->testArray(1));
27106bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->setVectors(this->testArray(42), this->testArray(1));
27206bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->V = std::move(this->V2);
27306bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->expectValues(this->V, this->testArray(1));
27406bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth
27506bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->setVectors(this->testArray(42), this->testArray(2));
27606bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->V = this->V2;
27706bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->expectValues(this->V, this->testArray(2));
27806bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->expectValues(this->V2, this->testArray(2));
27906bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->setVectors(this->testArray(42), this->testArray(2));
28006bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->V = std::move(this->V2);
28106bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->expectValues(this->V, this->testArray(2));
28206bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth
28306bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->setVectors(this->testArray(42), this->testArray(42));
28406bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->V = this->V2;
28506bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->expectValues(this->V, this->testArray(42));
28606bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->expectValues(this->V2, this->testArray(42));
28706bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->setVectors(this->testArray(42), this->testArray(42));
28806bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->V = std::move(this->V2);
28906bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth  this->expectValues(this->V, this->testArray(42));
29006bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth}
29106bd8ca8c276d9bc20b192188224e1e5215666a0Chandler Carruth
29240dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler CarruthTYPED_TEST(TinyPtrVectorTest, EraseTest) {
29340dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->appendValues(this->V, this->testArray(1));
29440dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->expectValues(this->V, this->testArray(1));
29540dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->V.erase(this->V.begin());
29640dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->expectValues(this->V, this->testArray(0));
29740dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth
29840dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->appendValues(this->V, this->testArray(42));
29940dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->expectValues(this->V, this->testArray(42));
30040dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->V.erase(this->V.begin());
30140dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->TestPtrs.erase(this->TestPtrs.begin());
30240dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->expectValues(this->V, this->testArray(41));
30336b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines  this->V.erase(std::next(this->V.begin(), 1));
30436b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines  this->TestPtrs.erase(std::next(this->TestPtrs.begin(), 1));
30540dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->expectValues(this->V, this->testArray(40));
30636b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines  this->V.erase(std::next(this->V.begin(), 2));
30736b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines  this->TestPtrs.erase(std::next(this->TestPtrs.begin(), 2));
30840dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->expectValues(this->V, this->testArray(39));
30936b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines  this->V.erase(std::next(this->V.begin(), 5));
31036b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines  this->TestPtrs.erase(std::next(this->TestPtrs.begin(), 5));
31140dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->expectValues(this->V, this->testArray(38));
31236b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines  this->V.erase(std::next(this->V.begin(), 13));
31336b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines  this->TestPtrs.erase(std::next(this->TestPtrs.begin(), 13));
31440dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->expectValues(this->V, this->testArray(37));
31540dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth
31640dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  typename TypeParam::iterator I = this->V.begin();
31740dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  do {
31840dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth    I = this->V.erase(I);
31940dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  } while (I != this->V.end());
32040dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth  this->expectValues(this->V, this->testArray(0));
32140dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth}
32240dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth
323147d9e05116518461653695a6022f6109f0eb936Chandler CarruthTYPED_TEST(TinyPtrVectorTest, EraseRangeTest) {
324147d9e05116518461653695a6022f6109f0eb936Chandler Carruth  this->appendValues(this->V, this->testArray(1));
325147d9e05116518461653695a6022f6109f0eb936Chandler Carruth  this->expectValues(this->V, this->testArray(1));
326147d9e05116518461653695a6022f6109f0eb936Chandler Carruth  this->V.erase(this->V.begin(), this->V.begin());
327147d9e05116518461653695a6022f6109f0eb936Chandler Carruth  this->expectValues(this->V, this->testArray(1));
328147d9e05116518461653695a6022f6109f0eb936Chandler Carruth  this->V.erase(this->V.end(), this->V.end());
329147d9e05116518461653695a6022f6109f0eb936Chandler Carruth  this->expectValues(this->V, this->testArray(1));
330147d9e05116518461653695a6022f6109f0eb936Chandler Carruth  this->V.erase(this->V.begin(), this->V.end());
331147d9e05116518461653695a6022f6109f0eb936Chandler Carruth  this->expectValues(this->V, this->testArray(0));
332147d9e05116518461653695a6022f6109f0eb936Chandler Carruth
333147d9e05116518461653695a6022f6109f0eb936Chandler Carruth  this->appendValues(this->V, this->testArray(42));
334147d9e05116518461653695a6022f6109f0eb936Chandler Carruth  this->expectValues(this->V, this->testArray(42));
33536b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines  this->V.erase(this->V.begin(), std::next(this->V.begin(), 1));
336147d9e05116518461653695a6022f6109f0eb936Chandler Carruth  this->TestPtrs.erase(this->TestPtrs.begin(),
33736b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines                       std::next(this->TestPtrs.begin(), 1));
338147d9e05116518461653695a6022f6109f0eb936Chandler Carruth  this->expectValues(this->V, this->testArray(41));
33936b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines  this->V.erase(std::next(this->V.begin(), 1), std::next(this->V.begin(), 2));
34036b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines  this->TestPtrs.erase(std::next(this->TestPtrs.begin(), 1),
34136b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines                       std::next(this->TestPtrs.begin(), 2));
342147d9e05116518461653695a6022f6109f0eb936Chandler Carruth  this->expectValues(this->V, this->testArray(40));
34336b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines  this->V.erase(std::next(this->V.begin(), 2), std::next(this->V.begin(), 4));
34436b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines  this->TestPtrs.erase(std::next(this->TestPtrs.begin(), 2),
34536b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines                       std::next(this->TestPtrs.begin(), 4));
346147d9e05116518461653695a6022f6109f0eb936Chandler Carruth  this->expectValues(this->V, this->testArray(38));
34736b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines  this->V.erase(std::next(this->V.begin(), 5), std::next(this->V.begin(), 10));
34836b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines  this->TestPtrs.erase(std::next(this->TestPtrs.begin(), 5),
34936b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines                       std::next(this->TestPtrs.begin(), 10));
350147d9e05116518461653695a6022f6109f0eb936Chandler Carruth  this->expectValues(this->V, this->testArray(33));
35136b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines  this->V.erase(std::next(this->V.begin(), 13), std::next(this->V.begin(), 26));
35236b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines  this->TestPtrs.erase(std::next(this->TestPtrs.begin(), 13),
35336b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines                       std::next(this->TestPtrs.begin(), 26));
354147d9e05116518461653695a6022f6109f0eb936Chandler Carruth  this->expectValues(this->V, this->testArray(20));
35536b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines  this->V.erase(std::next(this->V.begin(), 7), this->V.end());
356147d9e05116518461653695a6022f6109f0eb936Chandler Carruth  this->expectValues(this->V, this->testArray(7));
357147d9e05116518461653695a6022f6109f0eb936Chandler Carruth  this->V.erase(this->V.begin(), this->V.end());
358147d9e05116518461653695a6022f6109f0eb936Chandler Carruth  this->expectValues(this->V, this->testArray(0));
359147d9e05116518461653695a6022f6109f0eb936Chandler Carruth}
360147d9e05116518461653695a6022f6109f0eb936Chandler Carruth
361147d9e05116518461653695a6022f6109f0eb936Chandler CarruthTYPED_TEST(TinyPtrVectorTest, Insert) {
362147d9e05116518461653695a6022f6109f0eb936Chandler Carruth  this->V.insert(this->V.end(), this->TestPtrs[0]);
363147d9e05116518461653695a6022f6109f0eb936Chandler Carruth  this->expectValues(this->V, this->testArray(1));
364147d9e05116518461653695a6022f6109f0eb936Chandler Carruth  this->V.clear();
365147d9e05116518461653695a6022f6109f0eb936Chandler Carruth  this->appendValues(this->V, this->testArray(4));
366147d9e05116518461653695a6022f6109f0eb936Chandler Carruth  this->expectValues(this->V, this->testArray(4));
367147d9e05116518461653695a6022f6109f0eb936Chandler Carruth  this->V.insert(this->V.end(), this->TestPtrs[4]);
368147d9e05116518461653695a6022f6109f0eb936Chandler Carruth  this->expectValues(this->V, this->testArray(5));
369147d9e05116518461653695a6022f6109f0eb936Chandler Carruth  this->V.insert(this->V.begin(), this->TestPtrs[42]);
370147d9e05116518461653695a6022f6109f0eb936Chandler Carruth  this->TestPtrs.insert(this->TestPtrs.begin(), this->TestPtrs[42]);
371147d9e05116518461653695a6022f6109f0eb936Chandler Carruth  this->expectValues(this->V, this->testArray(6));
37236b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines  this->V.insert(std::next(this->V.begin(), 3), this->TestPtrs[43]);
37336b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines  this->TestPtrs.insert(std::next(this->TestPtrs.begin(), 3),
374147d9e05116518461653695a6022f6109f0eb936Chandler Carruth                        this->TestPtrs[43]);
375147d9e05116518461653695a6022f6109f0eb936Chandler Carruth  this->expectValues(this->V, this->testArray(7));
376147d9e05116518461653695a6022f6109f0eb936Chandler Carruth}
377147d9e05116518461653695a6022f6109f0eb936Chandler Carruth
378147d9e05116518461653695a6022f6109f0eb936Chandler CarruthTYPED_TEST(TinyPtrVectorTest, InsertRange) {
379147d9e05116518461653695a6022f6109f0eb936Chandler Carruth  this->V.insert(this->V.end(), this->TestPtrs.begin(), this->TestPtrs.begin());
380147d9e05116518461653695a6022f6109f0eb936Chandler Carruth  this->expectValues(this->V, this->testArray(0));
381147d9e05116518461653695a6022f6109f0eb936Chandler Carruth  this->V.insert(this->V.begin(), this->TestPtrs.begin(),
382147d9e05116518461653695a6022f6109f0eb936Chandler Carruth                 this->TestPtrs.begin());
383147d9e05116518461653695a6022f6109f0eb936Chandler Carruth  this->expectValues(this->V, this->testArray(0));
384147d9e05116518461653695a6022f6109f0eb936Chandler Carruth  this->V.insert(this->V.end(), this->TestPtrs.end(), this->TestPtrs.end());
385147d9e05116518461653695a6022f6109f0eb936Chandler Carruth  this->expectValues(this->V, this->testArray(0));
386147d9e05116518461653695a6022f6109f0eb936Chandler Carruth  this->V.insert(this->V.end(), this->TestPtrs.begin(),
38736b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines                 std::next(this->TestPtrs.begin()));
388147d9e05116518461653695a6022f6109f0eb936Chandler Carruth  this->expectValues(this->V, this->testArray(1));
389147d9e05116518461653695a6022f6109f0eb936Chandler Carruth  this->V.clear();
390147d9e05116518461653695a6022f6109f0eb936Chandler Carruth  this->V.insert(this->V.end(), this->TestPtrs.begin(),
39136b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines                 std::next(this->TestPtrs.begin(), 2));
392147d9e05116518461653695a6022f6109f0eb936Chandler Carruth  this->expectValues(this->V, this->testArray(2));
393147d9e05116518461653695a6022f6109f0eb936Chandler Carruth  this->V.clear();
394147d9e05116518461653695a6022f6109f0eb936Chandler Carruth  this->V.insert(this->V.end(), this->TestPtrs.begin(),
39536b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines                 std::next(this->TestPtrs.begin(), 42));
396147d9e05116518461653695a6022f6109f0eb936Chandler Carruth  this->expectValues(this->V, this->testArray(42));
397147d9e05116518461653695a6022f6109f0eb936Chandler Carruth  this->V.clear();
398147d9e05116518461653695a6022f6109f0eb936Chandler Carruth  this->V.insert(this->V.end(),
39936b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines                 std::next(this->TestPtrs.begin(), 5),
40036b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines                 std::next(this->TestPtrs.begin(), 13));
401147d9e05116518461653695a6022f6109f0eb936Chandler Carruth  this->V.insert(this->V.begin(),
40236b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines                 std::next(this->TestPtrs.begin(), 0),
40336b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines                 std::next(this->TestPtrs.begin(), 3));
40436b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines  this->V.insert(std::next(this->V.begin(), 2),
40536b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines                 std::next(this->TestPtrs.begin(), 2),
40636b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines                 std::next(this->TestPtrs.begin(), 4));
40736b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines  this->V.erase(std::next(this->V.begin(), 4));
40836b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines  this->V.insert(std::next(this->V.begin(), 4),
40936b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines                 std::next(this->TestPtrs.begin(), 4),
41036b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines                 std::next(this->TestPtrs.begin(), 5));
411147d9e05116518461653695a6022f6109f0eb936Chandler Carruth  this->expectValues(this->V, this->testArray(13));
412147d9e05116518461653695a6022f6109f0eb936Chandler Carruth}
413147d9e05116518461653695a6022f6109f0eb936Chandler Carruth
41440dab1059e72d3af59f2523fa8a7d05f40dafca5Chandler Carruth}
415