[C++11] Remove uses of LLVM_HAS_RVALUE_REFERENCES from the unittests.
authorChandler Carruth <chandlerc@gmail.com>
Sat, 1 Mar 2014 09:36:06 +0000 (09:36 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Sat, 1 Mar 2014 09:36:06 +0000 (09:36 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202583 91177308-0d34-0410-b5e6-96231b3b80d8

unittests/ADT/OptionalTest.cpp
unittests/ADT/SmallPtrSetTest.cpp
unittests/ADT/TinyPtrVectorTest.cpp
unittests/ADT/polymorphic_ptr_test.cpp
unittests/Support/Path.cpp
unittests/Support/RegexTest.cpp

index 21e38475d309f50b69e537c1eda4728bcb7d33cd..2da408c15e0b054d6604faf7d46ab62a5b87f153 100644 (file)
@@ -169,7 +169,6 @@ TEST_F(OptionalTest, NullCopyConstructionTest) {
   EXPECT_EQ(0u, NonDefaultConstructible::Destructions);
 }
 
-#if LLVM_HAS_RVALUE_REFERENCES
 struct MoveOnly {
   static unsigned MoveConstructions;
   static unsigned Destructions;
@@ -278,7 +277,6 @@ TEST_F(OptionalTest, MoveOnlyAssigningAssignment) {
   EXPECT_EQ(1u, MoveOnly::MoveAssignments);
   EXPECT_EQ(1u, MoveOnly::Destructions);
 }
-#endif
 
 } // end anonymous namespace
 
index 9b71cf07f23b6a558c4dc522d120fd450879104c..675f3373063a713a18e22a30bc2a002be8c54d19 100644 (file)
@@ -128,7 +128,6 @@ TEST(SmallPtrSetTest, CopyAndMoveTest) {
     else
       EXPECT_FALSE(s1.count(&buf[i]));
 
-#if LLVM_HAS_RVALUE_REFERENCES
   SmallPtrSet<int *, 4> s3(std::move(s1));
   EXPECT_EQ(4U, s3.size());
   EXPECT_TRUE(s1.empty());
@@ -156,7 +155,6 @@ TEST(SmallPtrSetTest, CopyAndMoveTest) {
   EXPECT_EQ(8U, s1.size());
   for (int i = 0; i < 8; ++i)
     EXPECT_TRUE(s3.count(&buf[i]));
-#endif
 }
 
 TEST(SmallPtrSetTest, SwapTest) {
index a4f92ffbe38372f815be2b800ba418a007ca2516..3ae1ae3deb1e5d39ad54afc5670e28563f77c2fe 100644 (file)
@@ -157,170 +157,136 @@ TYPED_TEST(TinyPtrVectorTest, CopyAndMoveCtorTest) {
   this->expectValues(Copy2, this->testArray(42));
   this->expectValues(this->V2, this->testArray(0));
 
-#if LLVM_HAS_RVALUE_REFERENCES
   TypeParam Move(std::move(Copy2));
   this->expectValues(Move, this->testArray(42));
   this->expectValues(Copy2, this->testArray(0));
-#endif
 }
 
 TYPED_TEST(TinyPtrVectorTest, CopyAndMoveTest) {
   this->V = this->V2;
   this->expectValues(this->V, this->testArray(0));
   this->expectValues(this->V2, this->testArray(0));
-#if LLVM_HAS_RVALUE_REFERENCES
   this->V = std::move(this->V2);
   this->expectValues(this->V, this->testArray(0));
-#endif
 
   this->setVectors(this->testArray(1), this->testArray(0));
   this->V = this->V2;
   this->expectValues(this->V, this->testArray(0));
   this->expectValues(this->V2, this->testArray(0));
-#if LLVM_HAS_RVALUE_REFERENCES
   this->setVectors(this->testArray(1), this->testArray(0));
   this->V = std::move(this->V2);
   this->expectValues(this->V, this->testArray(0));
-#endif
 
   this->setVectors(this->testArray(2), this->testArray(0));
   this->V = this->V2;
   this->expectValues(this->V, this->testArray(0));
   this->expectValues(this->V2, this->testArray(0));
-#if LLVM_HAS_RVALUE_REFERENCES
   this->setVectors(this->testArray(2), this->testArray(0));
   this->V = std::move(this->V2);
   this->expectValues(this->V, this->testArray(0));
-#endif
 
   this->setVectors(this->testArray(42), this->testArray(0));
   this->V = this->V2;
   this->expectValues(this->V, this->testArray(0));
   this->expectValues(this->V2, this->testArray(0));
-#if LLVM_HAS_RVALUE_REFERENCES
   this->setVectors(this->testArray(42), this->testArray(0));
   this->V = std::move(this->V2);
   this->expectValues(this->V, this->testArray(0));
-#endif
 
   this->setVectors(this->testArray(0), this->testArray(1));
   this->V = this->V2;
   this->expectValues(this->V, this->testArray(1));
   this->expectValues(this->V2, this->testArray(1));
-#if LLVM_HAS_RVALUE_REFERENCES
   this->setVectors(this->testArray(0), this->testArray(1));
   this->V = std::move(this->V2);
   this->expectValues(this->V, this->testArray(1));
-#endif
 
   this->setVectors(this->testArray(0), this->testArray(2));
   this->V = this->V2;
   this->expectValues(this->V, this->testArray(2));
   this->expectValues(this->V2, this->testArray(2));
-#if LLVM_HAS_RVALUE_REFERENCES
   this->setVectors(this->testArray(0), this->testArray(2));
   this->V = std::move(this->V2);
   this->expectValues(this->V, this->testArray(2));
-#endif
 
   this->setVectors(this->testArray(0), this->testArray(42));
   this->V = this->V2;
   this->expectValues(this->V, this->testArray(42));
   this->expectValues(this->V2, this->testArray(42));
-#if LLVM_HAS_RVALUE_REFERENCES
   this->setVectors(this->testArray(0), this->testArray(42));
   this->V = std::move(this->V2);
   this->expectValues(this->V, this->testArray(42));
-#endif
 
   this->setVectors(this->testArray(1), this->testArray(1));
   this->V = this->V2;
   this->expectValues(this->V, this->testArray(1));
   this->expectValues(this->V2, this->testArray(1));
-#if LLVM_HAS_RVALUE_REFERENCES
   this->V = std::move(this->V2);
   this->expectValues(this->V, this->testArray(1));
-#endif
 
   this->setVectors(this->testArray(1), this->testArray(2));
   this->V = this->V2;
   this->expectValues(this->V, this->testArray(2));
   this->expectValues(this->V2, this->testArray(2));
-#if LLVM_HAS_RVALUE_REFERENCES
   this->setVectors(this->testArray(1), this->testArray(2));
   this->V = std::move(this->V2);
   this->expectValues(this->V, this->testArray(2));
-#endif
 
   this->setVectors(this->testArray(1), this->testArray(42));
   this->V = this->V2;
   this->expectValues(this->V, this->testArray(42));
   this->expectValues(this->V2, this->testArray(42));
-#if LLVM_HAS_RVALUE_REFERENCES
   this->setVectors(this->testArray(1), this->testArray(42));
   this->V = std::move(this->V2);
   this->expectValues(this->V, this->testArray(42));
-#endif
 
   this->setVectors(this->testArray(2), this->testArray(1));
   this->V = this->V2;
   this->expectValues(this->V, this->testArray(1));
   this->expectValues(this->V2, this->testArray(1));
-#if LLVM_HAS_RVALUE_REFERENCES
   this->setVectors(this->testArray(2), this->testArray(1));
   this->V = std::move(this->V2);
   this->expectValues(this->V, this->testArray(1));
-#endif
 
   this->setVectors(this->testArray(2), this->testArray(2));
   this->V = this->V2;
   this->expectValues(this->V, this->testArray(2));
   this->expectValues(this->V2, this->testArray(2));
-#if LLVM_HAS_RVALUE_REFERENCES
   this->setVectors(this->testArray(2), this->testArray(2));
   this->V = std::move(this->V2);
   this->expectValues(this->V, this->testArray(2));
-#endif
 
   this->setVectors(this->testArray(2), this->testArray(42));
   this->V = this->V2;
   this->expectValues(this->V, this->testArray(42));
   this->expectValues(this->V2, this->testArray(42));
-#if LLVM_HAS_RVALUE_REFERENCES
   this->setVectors(this->testArray(2), this->testArray(42));
   this->V = std::move(this->V2);
   this->expectValues(this->V, this->testArray(42));
-#endif
 
   this->setVectors(this->testArray(42), this->testArray(1));
   this->V = this->V2;
   this->expectValues(this->V, this->testArray(1));
   this->expectValues(this->V2, this->testArray(1));
-#if LLVM_HAS_RVALUE_REFERENCES
   this->setVectors(this->testArray(42), this->testArray(1));
   this->V = std::move(this->V2);
   this->expectValues(this->V, this->testArray(1));
-#endif
 
   this->setVectors(this->testArray(42), this->testArray(2));
   this->V = this->V2;
   this->expectValues(this->V, this->testArray(2));
   this->expectValues(this->V2, this->testArray(2));
-#if LLVM_HAS_RVALUE_REFERENCES
   this->setVectors(this->testArray(42), this->testArray(2));
   this->V = std::move(this->V2);
   this->expectValues(this->V, this->testArray(2));
-#endif
 
   this->setVectors(this->testArray(42), this->testArray(42));
   this->V = this->V2;
   this->expectValues(this->V, this->testArray(42));
   this->expectValues(this->V2, this->testArray(42));
-#if LLVM_HAS_RVALUE_REFERENCES
   this->setVectors(this->testArray(42), this->testArray(42));
   this->V = std::move(this->V2);
   this->expectValues(this->V, this->testArray(42));
-#endif
 }
 
 TYPED_TEST(TinyPtrVectorTest, EraseTest) {
index bd5d83879a83fa5cb419f83808e5bbf01c7523f7..8198d1f32c0afae6c84cb20882b8e348253be671 100644 (file)
@@ -58,10 +58,6 @@ TEST(polymorphic_ptr_test, Basic) {
   EXPECT_EQ(42, p->x);
 
   polymorphic_ptr<S> p2((llvm_move(p)));
-#if !LLVM_HAS_RVALUE_REFERENCES
-  // 'p' may not have been moved from in C++98, fake it for the test.
-  p2 = p.take();
-#endif
   EXPECT_FALSE((bool)p);
   EXPECT_TRUE(!p);
   EXPECT_TRUE((bool)p2);
index f10faf9908b4e92dce186904e2aa623315ff5cad..d07bb5616b5c4e08919fc27258f006647aaddb06 100644 (file)
@@ -581,7 +581,6 @@ TEST_F(FileSystemTest, FileMapping) {
 
   // Unmap temp file
 
-#if LLVM_HAS_RVALUE_REFERENCES
   fs::mapped_file_region m(Twine(TempPath),
                              fs::mapped_file_region::readonly,
                              0,
@@ -591,6 +590,5 @@ TEST_F(FileSystemTest, FileMapping) {
   const char *Data = m.const_data();
   fs::mapped_file_region mfrrv(llvm_move(m));
   EXPECT_EQ(mfrrv.const_data(), Data);
-#endif
 }
 } // anonymous namespace
index c3a8085accde5d3ec9f89b1d2ae8802514291445..c045c49bc3d7cde5c3ce504ae324da649d674038 100644 (file)
@@ -140,7 +140,6 @@ TEST_F(RegexTest, IsValid) {
   EXPECT_EQ("invalid character range", Error);
 }
 
-#if LLVM_HAS_RVALUE_REFERENCES
 TEST_F(RegexTest, MoveConstruct) {
   Regex r1("^[0-9]+$");
   Regex r2(std::move(r1));
@@ -153,6 +152,5 @@ TEST_F(RegexTest, MoveAssign) {
   r2 = std::move(r1);
   EXPECT_TRUE(r2.match("916"));
 }
-#endif
 
 }