diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2013-06-07 15:14:31 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2013-06-07 15:14:31 +0000 |
commit | a77376dae1e26572f94aa52b63f89749b785bc33 (patch) | |
tree | b5b1d8ae91015bdb2895b4ee3c9f5def314660a4 /unittests | |
parent | 597253da97ec4fa5fa4a03c2230ed026b1b6aad6 (diff) | |
download | external_llvm-a77376dae1e26572f94aa52b63f89749b785bc33.zip external_llvm-a77376dae1e26572f94aa52b63f89749b785bc33.tar.gz external_llvm-a77376dae1e26572f94aa52b63f89749b785bc33.tar.bz2 |
BitVector: Do the right thing in all() when Size is a multiple of BITWORD_SIZE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183525 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r-- | unittests/ADT/BitVectorTest.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/unittests/ADT/BitVectorTest.cpp b/unittests/ADT/BitVectorTest.cpp index f97be22..85e1594 100644 --- a/unittests/ADT/BitVectorTest.cpp +++ b/unittests/ADT/BitVectorTest.cpp @@ -149,6 +149,22 @@ TYPED_TEST(BitVectorTest, TrivialOperation) { EXPECT_FALSE(Vec.none()); EXPECT_FALSE(Vec.empty()); + Vec.resize(64); + EXPECT_EQ(64U, Vec.count()); + EXPECT_EQ(64U, Vec.size()); + EXPECT_TRUE(Vec.any()); + EXPECT_TRUE(Vec.all()); + EXPECT_FALSE(Vec.none()); + EXPECT_FALSE(Vec.empty()); + + Vec.flip(); + EXPECT_EQ(0U, Vec.count()); + EXPECT_EQ(64U, Vec.size()); + EXPECT_FALSE(Vec.any()); + EXPECT_FALSE(Vec.all()); + EXPECT_TRUE(Vec.none()); + EXPECT_FALSE(Vec.empty()); + Inv = TypeParam().flip(); EXPECT_EQ(0U, Inv.count()); EXPECT_EQ(0U, Inv.size()); |