diff options
author | rdivacky <rdivacky@FreeBSD.org> | 2010-02-16 09:30:23 +0000 |
---|---|---|
committer | rdivacky <rdivacky@FreeBSD.org> | 2010-02-16 09:30:23 +0000 |
commit | f25ddd991a5601d0101602c4c263a58c7af4b8a2 (patch) | |
tree | 4cfca640904d1896e25032757a61f8959c066919 /unittests/ADT/BitVectorTest.cpp | |
parent | 3fd58f91dd318518f7daa4ba64c0aaf31799d89b (diff) | |
download | FreeBSD-src-f25ddd991a5601d0101602c4c263a58c7af4b8a2.zip FreeBSD-src-f25ddd991a5601d0101602c4c263a58c7af4b8a2.tar.gz |
Update LLVM to r96341.
Diffstat (limited to 'unittests/ADT/BitVectorTest.cpp')
-rw-r--r-- | unittests/ADT/BitVectorTest.cpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/unittests/ADT/BitVectorTest.cpp b/unittests/ADT/BitVectorTest.cpp index 5348281..4fe11c1 100644 --- a/unittests/ADT/BitVectorTest.cpp +++ b/unittests/ADT/BitVectorTest.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +#ifndef XFAIL #include "llvm/ADT/BitVector.h" #include "gtest/gtest.h" @@ -137,4 +138,45 @@ TEST(BitVectorTest, TrivialOperation) { EXPECT_TRUE(Vec.empty()); } +TEST(BitVectorTest, CompoundAssignment) { + BitVector A; + A.resize(10); + A.set(4); + A.set(7); + + BitVector B; + B.resize(50); + B.set(5); + B.set(18); + + A |= B; + EXPECT_TRUE(A.test(4)); + EXPECT_TRUE(A.test(5)); + EXPECT_TRUE(A.test(7)); + EXPECT_TRUE(A.test(18)); + EXPECT_EQ(4U, A.count()); + EXPECT_EQ(50U, A.size()); + + B.resize(10); + B.set(); + B.reset(2); + B.reset(7); + A &= B; + EXPECT_FALSE(A.test(2)); + EXPECT_FALSE(A.test(7)); + EXPECT_EQ(2U, A.count()); + EXPECT_EQ(50U, A.size()); + + B.resize(100); + B.set(); + + A ^= B; + EXPECT_TRUE(A.test(2)); + EXPECT_TRUE(A.test(7)); + EXPECT_EQ(98U, A.count()); + EXPECT_EQ(100U, A.size()); } + +} + +#endif |