summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/ADT/BitVectorTest.cpp
diff options
context:
space:
mode:
authorYaron Keren <yaron.keren@gmail.com>2015-09-18 15:08:24 +0000
committerYaron Keren <yaron.keren@gmail.com>2015-09-18 15:08:24 +0000
commita89b833c4f7a43e33f888176dd4aea2e45762564 (patch)
tree3e75e91c0454b72422eddb46bb1ea2614cb2f9f3 /llvm/unittests/ADT/BitVectorTest.cpp
parent5c2310c30cf57d88dde20dbd0d8f86f2f8bfd4a7 (diff)
downloadbcm5719-llvm-a89b833c4f7a43e33f888176dd4aea2e45762564.tar.gz
bcm5719-llvm-a89b833c4f7a43e33f888176dd4aea2e45762564.zip
Simplify SmallBitVector::applyMask by consolidating common code for 32- and 64-bit builds
and assert when mask is too large to apply in the small case, previously the extra words were silently ignored. clang-format the entire function to match current code standards. This is a rewrite of r247972 which was reverted in r247983 due to warning and possible UB on 32-bits hosts. llvm-svn: 247993
Diffstat (limited to 'llvm/unittests/ADT/BitVectorTest.cpp')
-rw-r--r--llvm/unittests/ADT/BitVectorTest.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/unittests/ADT/BitVectorTest.cpp b/llvm/unittests/ADT/BitVectorTest.cpp
index 3deaff0fe35..95ff93fa9c4 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, 1);
EXPECT_EQ(10u, A.size());
EXPECT_FALSE(A.test(0));
A.resize(32);
- A.setBitsInMask(Mask1, 3);
+ A.setBitsInMask(Mask1, 1);
EXPECT_FALSE(A.test(0));
EXPECT_TRUE(A.test(31));
EXPECT_EQ(1u, A.count());
OpenPOWER on IntegriCloud