aboutsummaryrefslogtreecommitdiffstats
path: root/unittests
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2010-04-30 12:29:39 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2010-04-30 12:29:39 +0000
commitb252fbd179c494b3c6220f6f7e42f3ff5d15bda6 (patch)
tree42b39211e7380652142959c54dae606567f8e801 /unittests
parent1e44aa0412473297994afb8b707d0326472fd2a4 (diff)
downloadexternal_llvm-b252fbd179c494b3c6220f6f7e42f3ff5d15bda6.zip
external_llvm-b252fbd179c494b3c6220f6f7e42f3ff5d15bda6.tar.gz
external_llvm-b252fbd179c494b3c6220f6f7e42f3ff5d15bda6.tar.bz2
Implement a read/write operator[] for SmallBitVector with a proxy class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102709 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r--unittests/ADT/SmallBitVectorTest.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/unittests/ADT/SmallBitVectorTest.cpp b/unittests/ADT/SmallBitVectorTest.cpp
index a2cc652ca..a0c079d 100644
--- a/unittests/ADT/SmallBitVectorTest.cpp
+++ b/unittests/ADT/SmallBitVectorTest.cpp
@@ -176,4 +176,12 @@ TEST(SmallBitVectorTest, CompoundAssignment) {
EXPECT_EQ(100U, A.size());
}
+TEST(SmallBitVectorTest, ProxyIndex) {
+ SmallBitVector 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());
+}
}