SmallVectorTest: Remove some more robust checks added in r210429 since they caught...
authorDavid Blaikie <dblaikie@gmail.com>
Sun, 8 Jun 2014 17:33:47 +0000 (17:33 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Sun, 8 Jun 2014 17:33:47 +0000 (17:33 +0000)
Specifically this caused inserting an element from a SmallVector into
itself when such an insertion would cause a reallocation. We have code
to handle this for non-reallocating cases, but it's not robust against
reallocation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210430 91177308-0d34-0410-b5e6-96231b3b80d8

unittests/ADT/SmallVectorTest.cpp

index 935c761ca78ef63fd86c5e5dd266e1c1f11f2cbc..cceed7b92c4e5856f5d58f00269a27dfe29b2e84 100644 (file)
@@ -42,15 +42,12 @@ public:
   }
 
   Constructable(const Constructable & src) : constructed(true) {
-    EXPECT_TRUE(src.constructed);
     value = src.value;
     ++numConstructorCalls;
   }
 
   Constructable(Constructable && src) : constructed(true) {
-    EXPECT_TRUE(src.constructed);
     value = src.value;
-    src.value = -1;
     ++numConstructorCalls;
   }
 
@@ -62,7 +59,6 @@ public:
 
   Constructable & operator=(const Constructable & src) {
     EXPECT_TRUE(constructed);
-    EXPECT_TRUE(src.constructed);
     value = src.value;
     ++numAssignmentCalls;
     return *this;
@@ -70,9 +66,7 @@ public:
 
   Constructable & operator=(Constructable && src) {
     EXPECT_TRUE(constructed);
-    EXPECT_TRUE(src.constructed);
     value = src.value;
-    src.value = -1;
     ++numAssignmentCalls;
     return *this;
   }