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 | 04b8daa9708751750b80c1ee61320e111e739e37 (patch) | |
| tree | 46cb5138a66ea8808ef931cd08d5c037fbf23702 /llvm/unittests/ADT | |
| parent | 2a3f77585fb9f2e1d6deb87d0b7325cfd95948e6 (diff) | |
| download | bcm5719-llvm-04b8daa9708751750b80c1ee61320e111e739e37.tar.gz bcm5719-llvm-04b8daa9708751750b80c1ee61320e111e739e37.zip | |
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.
llvm-svn: 166015
Diffstat (limited to 'llvm/unittests/ADT')
| -rw-r--r-- | llvm/unittests/ADT/BitVectorTest.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/unittests/ADT/BitVectorTest.cpp b/llvm/unittests/ADT/BitVectorTest.cpp index e50ff8a67a8..dc298a83d57 100644 --- a/llvm/unittests/ADT/BitVectorTest.cpp +++ b/llvm/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 |

