[llvm] r202583 - [C++11] Remove uses of LLVM_HAS_RVALUE_REFERENCES from the unittests.

Chandler Carruth chandlerc at gmail.com
Sat Mar 1 01:36:07 PST 2014


Author: chandlerc
Date: Sat Mar  1 03:36:06 2014
New Revision: 202583

URL: http://llvm.org/viewvc/llvm-project?rev=202583&view=rev
Log:
[C++11] Remove uses of LLVM_HAS_RVALUE_REFERENCES from the unittests.

Modified:
    llvm/trunk/unittests/ADT/OptionalTest.cpp
    llvm/trunk/unittests/ADT/SmallPtrSetTest.cpp
    llvm/trunk/unittests/ADT/TinyPtrVectorTest.cpp
    llvm/trunk/unittests/ADT/polymorphic_ptr_test.cpp
    llvm/trunk/unittests/Support/Path.cpp
    llvm/trunk/unittests/Support/RegexTest.cpp

Modified: llvm/trunk/unittests/ADT/OptionalTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ADT/OptionalTest.cpp?rev=202583&r1=202582&r2=202583&view=diff
==============================================================================
--- llvm/trunk/unittests/ADT/OptionalTest.cpp (original)
+++ llvm/trunk/unittests/ADT/OptionalTest.cpp Sat Mar  1 03:36:06 2014
@@ -169,7 +169,6 @@ TEST_F(OptionalTest, NullCopyConstructio
   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, MoveOnlyAssigningAs
   EXPECT_EQ(1u, MoveOnly::MoveAssignments);
   EXPECT_EQ(1u, MoveOnly::Destructions);
 }
-#endif
 
 } // end anonymous namespace
 

Modified: llvm/trunk/unittests/ADT/SmallPtrSetTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ADT/SmallPtrSetTest.cpp?rev=202583&r1=202582&r2=202583&view=diff
==============================================================================
--- llvm/trunk/unittests/ADT/SmallPtrSetTest.cpp (original)
+++ llvm/trunk/unittests/ADT/SmallPtrSetTest.cpp Sat Mar  1 03:36:06 2014
@@ -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) {

Modified: llvm/trunk/unittests/ADT/TinyPtrVectorTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ADT/TinyPtrVectorTest.cpp?rev=202583&r1=202582&r2=202583&view=diff
==============================================================================
--- llvm/trunk/unittests/ADT/TinyPtrVectorTest.cpp (original)
+++ llvm/trunk/unittests/ADT/TinyPtrVectorTest.cpp Sat Mar  1 03:36:06 2014
@@ -157,170 +157,136 @@ TYPED_TEST(TinyPtrVectorTest, CopyAndMov
   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) {

Modified: llvm/trunk/unittests/ADT/polymorphic_ptr_test.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ADT/polymorphic_ptr_test.cpp?rev=202583&r1=202582&r2=202583&view=diff
==============================================================================
--- llvm/trunk/unittests/ADT/polymorphic_ptr_test.cpp (original)
+++ llvm/trunk/unittests/ADT/polymorphic_ptr_test.cpp Sat Mar  1 03:36:06 2014
@@ -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);

Modified: llvm/trunk/unittests/Support/Path.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Support/Path.cpp?rev=202583&r1=202582&r2=202583&view=diff
==============================================================================
--- llvm/trunk/unittests/Support/Path.cpp (original)
+++ llvm/trunk/unittests/Support/Path.cpp Sat Mar  1 03:36:06 2014
@@ -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

Modified: llvm/trunk/unittests/Support/RegexTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Support/RegexTest.cpp?rev=202583&r1=202582&r2=202583&view=diff
==============================================================================
--- llvm/trunk/unittests/Support/RegexTest.cpp (original)
+++ llvm/trunk/unittests/Support/RegexTest.cpp Sat Mar  1 03:36:06 2014
@@ -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
 
 }





More information about the llvm-commits mailing list