Update BitVectorTest.cpp to stay in sync with SmallBitVectorTest.cpp,
and fix a bug in BitVector's reference proxy class which this exposed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102768 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/unittests/ADT/BitVectorTest.cpp b/unittests/ADT/BitVectorTest.cpp
index 4fe11c1..a9fc133 100644
--- a/unittests/ADT/BitVectorTest.cpp
+++ b/unittests/ADT/BitVectorTest.cpp
@@ -7,7 +7,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef XFAIL
+// Some of these tests fail on PowerPC for unknown reasons.
+#ifndef __ppc__
+
 #include "llvm/ADT/BitVector.h"
 #include "gtest/gtest.h"
 
@@ -56,7 +58,7 @@
   Vec.resize(26, true);
   Vec.resize(29, false);
   Vec.resize(33, true);
-  Vec.resize(61, false);
+  Vec.resize(57, false);
   unsigned Count = 0;
   for (unsigned i = Vec.find_first(); i != -1u; i = Vec.find_next(i)) {
     ++Count;
@@ -67,7 +69,8 @@
   EXPECT_EQ(Count, 23u);
   EXPECT_FALSE(Vec[0]);
   EXPECT_TRUE(Vec[32]);
-  EXPECT_FALSE(Vec[60]);
+  EXPECT_FALSE(Vec[56]);
+  Vec.resize(61, false);
 
   BitVector Copy = Vec;
   BitVector Alt(3, false);
@@ -177,6 +180,15 @@
   EXPECT_EQ(100U, A.size());
 }
 
+TEST(BitVectorTest, ProxyIndex) {
+  BitVector Vec(3);
+  EXPECT_TRUE(Vec.none());
+  Vec[0] = Vec[1] = Vec[2] = true;
+  EXPECT_EQ(Vec.size(), Vec.count());
+  Vec[2] = Vec[1] = Vec[0] = false;
+  EXPECT_TRUE(Vec.none());
+}
+
 }
 
 #endif