diff options
| author | Yaron Keren <yaron.keren@gmail.com> | 2015-09-18 06:35:12 +0000 |
|---|---|---|
| committer | Yaron Keren <yaron.keren@gmail.com> | 2015-09-18 06:35:12 +0000 |
| commit | 733ccaab6116ac8b62836eaa266fcf095dc38de2 (patch) | |
| tree | e0a9360d5305c106468d008d450f272e27f2b2be /llvm/unittests/ADT/BitVectorTest.cpp | |
| parent | 172d7128558d42d5fe0e7c40ba23abaa7984fa25 (diff) | |
| download | llvm-733ccaab6116ac8b62836eaa266fcf095dc38de2.zip llvm-733ccaab6116ac8b62836eaa266fcf095dc38de2.tar.gz llvm-733ccaab6116ac8b62836eaa266fcf095dc38de2.tar.bz2 | |
Simplify SmallBitVector::applyMask by consolidating common code for 32-bit and 64-bit builds.
Extend mask value to 64 bits before taking its complement and assert when mask is
too large to apply in the small case (previously the extra words were silently ignored).
http://reviews.llvm.org/D11890
Patch by James Touton!
llvm-svn: 247972
Diffstat (limited to 'llvm/unittests/ADT/BitVectorTest.cpp')
| -rw-r--r-- | llvm/unittests/ADT/BitVectorTest.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/unittests/ADT/BitVectorTest.cpp b/llvm/unittests/ADT/BitVectorTest.cpp index 3deaff0..5d99e1d 100644 --- a/llvm/unittests/ADT/BitVectorTest.cpp +++ b/llvm/unittests/ADT/BitVectorTest.cpp @@ -235,12 +235,12 @@ TYPED_TEST(BitVectorTest, PortableBitMask) { const uint32_t Mask1[] = { 0x80000000, 6, 5 }; A.resize(10); - A.setBitsInMask(Mask1, 3); + A.setBitsInMask(Mask1, 2); EXPECT_EQ(10u, A.size()); EXPECT_FALSE(A.test(0)); A.resize(32); - A.setBitsInMask(Mask1, 3); + A.setBitsInMask(Mask1, 2); EXPECT_FALSE(A.test(0)); EXPECT_TRUE(A.test(31)); EXPECT_EQ(1u, A.count()); |
