• Home
  • Raw
  • Download

Lines Matching refs:BV

19 bool elementsMatch(const UBitVec &BV, std::initializer_list<unsigned> List) {  in elementsMatch()  argument
20 if (!std::equal(BV.begin(), BV.end(), List.begin(), List.end())) { in elementsMatch()
28 BV.print(dbgs()); in elementsMatch()
54 UBitVec BV(Alloc); in TEST() local
55 EXPECT_EQ(BV.count(), 0u); in TEST()
56 BV.set(0); in TEST()
57 EXPECT_EQ(BV.count(), 1u); in TEST()
58 BV.set({11, 12, 13, 14, 15}); in TEST()
59 EXPECT_EQ(BV.count(), 6u); in TEST()
64 UBitVec BV(Alloc); in TEST() local
65 EXPECT_TRUE(BV.empty()); in TEST()
66 BV.set(1); in TEST()
67 EXPECT_FALSE(BV.empty()); in TEST()
68 BV.clear(); in TEST()
69 EXPECT_TRUE(BV.empty()); in TEST()
87 UBitVec BV(Alloc); in TEST() local
89 BV.set({0, 1, 2}); in TEST()
91 auto It = BV.begin(); in TEST()
92 EXPECT_TRUE(It == BV.begin()); in TEST()
99 EXPECT_TRUE(It == BV.end()); in TEST()
100 EXPECT_TRUE(BV.end() == BV.end()); in TEST()
102 It = BV.begin(); in TEST()
103 EXPECT_TRUE(It == BV.begin()); in TEST()
105 EXPECT_TRUE(ItCopy == BV.begin()); in TEST()
109 EXPECT_TRUE(elementsMatch(BV, {0, 1, 2})); in TEST()
111 BV.set({4, 5, 6}); in TEST()
112 EXPECT_TRUE(elementsMatch(BV, {0, 1, 2, 4, 5, 6})); in TEST()
114 BV.set(3); in TEST()
115 EXPECT_TRUE(elementsMatch(BV, {0, 1, 2, 3, 4, 5, 6})); in TEST()
117 BV.set(10); in TEST()
118 EXPECT_TRUE(elementsMatch(BV, {0, 1, 2, 3, 4, 5, 6, 10})); in TEST()
121 BV.reset(3); in TEST()
122 BV.reset(3); in TEST()
123 BV.reset(20000); in TEST()
124 BV.set({1000, 1001, 1002}); in TEST()
125 EXPECT_TRUE(elementsMatch(BV, {0, 1, 2, 4, 5, 6, 10, 1000, 1001, 1002})); in TEST()
127 auto It1 = BV.begin(); in TEST()
128 EXPECT_TRUE(It1 == BV.begin()); in TEST()
129 EXPECT_TRUE(++It1 == ++BV.begin()); in TEST()
130 EXPECT_TRUE(It1 != BV.begin()); in TEST()
131 EXPECT_TRUE(It1 != BV.end()); in TEST()
136 UBitVec BV(Alloc); in TEST() local
138 BV.set(0); in TEST()
139 EXPECT_TRUE(BV.test(0)); in TEST()
140 BV.reset(0); in TEST()
141 EXPECT_FALSE(BV.test(0)); in TEST()
143 BV.clear(); in TEST()
144 BV.set({1, 2, 3}); in TEST()
145 BV.reset(1); in TEST()
146 EXPECT_TRUE(elementsMatch(BV, {2, 3})); in TEST()
148 BV.clear(); in TEST()
149 BV.set({1, 2, 3}); in TEST()
150 BV.reset(2); in TEST()
151 EXPECT_TRUE(elementsMatch(BV, {1, 3})); in TEST()
153 BV.clear(); in TEST()
154 BV.set({1, 2, 3}); in TEST()
155 BV.reset(3); in TEST()
156 EXPECT_TRUE(elementsMatch(BV, {1, 2})); in TEST()
434 U64BitVec BV(Alloc); in TEST() local
437 EXPECT_TRUE(BV.find(BigNum1) == BV.end()); in TEST()
438 BV.set(BigNum1); in TEST()
439 auto Find1 = BV.find(BigNum1); in TEST()
441 BV.set(BigNum2); in TEST()
442 auto Find2 = BV.find(BigNum1); in TEST()
444 auto Find3 = BV.find(BigNum2); in TEST()
446 BV.reset(BigNum1); in TEST()
447 auto Find4 = BV.find(BigNum1); in TEST()
450 BV.clear(); in TEST()
451 BV.set({1, 2, 3}); in TEST()
452 EXPECT_EQ(*BV.find(2), 2u); in TEST()
453 EXPECT_EQ(*BV.find(3), 3u); in TEST()
458 U64BitVec BV(Alloc); in TEST() local
463 auto It = BV.begin(); in TEST()
468 EXPECT_TRUE(advFromBegin(BigNum1) == BV.end()); in TEST()
469 BV.set(BigNum1); in TEST()
472 BV.set(BigNum2); in TEST()
477 BV.reset(BigNum1); in TEST()
481 BV.clear(); in TEST()
482 BV.set({1, 2, 3}); in TEST()
485 auto It = BV.begin(); in TEST()
489 EXPECT_TRUE(It == BV.end()); in TEST()
491 EXPECT_TRUE(It == BV.end()); in TEST()
498 UBitVec BV(Alloc); in TEST() local
499 BV.set({1, 2, 3}); in TEST()
501 EXPECT_EQ(*BV.find(0), 1U); // find(Start) > Start in TEST()
502 EXPECT_TRUE(rangesMatch(BV.half_open_range(0, 5), {1, 2, 3})); in TEST()
503 EXPECT_TRUE(rangesMatch(BV.half_open_range(1, 4), {1, 2, 3})); in TEST()
504 EXPECT_TRUE(rangesMatch(BV.half_open_range(1, 3), {1, 2})); in TEST()
505 EXPECT_TRUE(rangesMatch(BV.half_open_range(2, 3), {2})); in TEST()
506 EXPECT_TRUE(rangesMatch(BV.half_open_range(2, 4), {2, 3})); in TEST()
507 EXPECT_TRUE(rangesMatch(BV.half_open_range(4, 5), {})); in TEST()
511 UBitVec BV(Alloc); in TEST() local
512 BV.set({1, 2, 11, 12}); in TEST()
514 EXPECT_TRUE(rangesMatch(BV.half_open_range(0, 15), {1, 2, 11, 12})); in TEST()
515 EXPECT_TRUE(rangesMatch(BV.half_open_range(1, 13), {1, 2, 11, 12})); in TEST()
516 EXPECT_TRUE(rangesMatch(BV.half_open_range(1, 12), {1, 2, 11})); in TEST()
518 EXPECT_TRUE(rangesMatch(BV.half_open_range(0, 5), {1, 2})); in TEST()
519 EXPECT_TRUE(rangesMatch(BV.half_open_range(1, 5), {1, 2})); in TEST()
520 EXPECT_TRUE(rangesMatch(BV.half_open_range(2, 5), {2})); in TEST()
521 EXPECT_TRUE(rangesMatch(BV.half_open_range(1, 2), {1})); in TEST()
522 EXPECT_TRUE(rangesMatch(BV.half_open_range(13, 14), {})); in TEST()
524 EXPECT_TRUE(rangesMatch(BV.half_open_range(2, 10), {2})); in TEST()
528 UBitVec BV(Alloc); in TEST() local
529 BV.set({1}); in TEST()
531 EXPECT_EQ(*BV.find(0), 1U); // find(Start) == End in TEST()
532 EXPECT_TRUE(rangesMatch(BV.half_open_range(0, 1), {})); in TEST()
536 UBitVec BV(Alloc); in TEST() local
537 BV.set({5}); in TEST()
539 EXPECT_EQ(*BV.find(3), 5U); // find(Start) > End in TEST()
540 EXPECT_TRUE(rangesMatch(BV.half_open_range(3, 4), {})); in TEST()
549 UBitVec BV(Alloc); in TEST() local
550 BV.set({1}); in TEST()
551 BV.print(OS); in TEST()
553 BV.clear(); in TEST()
554 BV.set({1, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20}); in TEST()
555 BV.print(OS); in TEST()