diff options
author | Owen Anderson <resistor@mac.com> | 2012-10-16 06:04:27 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2012-10-16 06:04:27 +0000 |
commit | e3f7be36c75ddcafb24b52c36c55c3dc17215db3 (patch) | |
tree | b80d57738343f6617c7e69f80089beb6bd3ff4b7 /unittests/ADT | |
parent | fdc054c3a393cff235a499edaa714f94f6b35d0f (diff) |
Fix a bug in the set(I,E)/reset(I,E) methods that I recently added. The boundary condition for checking if I and E were in the same word were incorrect, and, beyond that, the mask computation was not using a wide enough constant.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166015 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/ADT')
-rw-r--r-- | unittests/ADT/BitVectorTest.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/unittests/ADT/BitVectorTest.cpp b/unittests/ADT/BitVectorTest.cpp index e50ff8a67a..dc298a83d5 100644 --- a/unittests/ADT/BitVectorTest.cpp +++ b/unittests/ADT/BitVectorTest.cpp @@ -322,6 +322,16 @@ TYPED_TEST(BitVectorTest, RangeOps) { EXPECT_FALSE(D.test(0)); EXPECT_TRUE( D.test(1)); EXPECT_TRUE( D.test(2)); + + TypeParam E; + E.resize(128); + E.reset(); + E.set(1, 33); + + EXPECT_FALSE(E.test(0)); + EXPECT_TRUE( E.test(1)); + EXPECT_TRUE( E.test(32)); + EXPECT_FALSE(E.test(33)); } } #endif |