Lines Matching refs:EXPECT_EQ
37 EXPECT_EQ(126u, Minus3.countLeadingOnes()); in TEST()
38 EXPECT_EQ(-3, Minus3.getSExtValue()); in TEST()
41 EXPECT_EQ(0u, Minus1.countLeadingZeros()); in TEST()
42 EXPECT_EQ(128u, Minus1.countLeadingOnes()); in TEST()
43 EXPECT_EQ(128u, Minus1.getActiveBits()); in TEST()
44 EXPECT_EQ(0u, Minus1.countTrailingZeros()); in TEST()
45 EXPECT_EQ(128u, Minus1.countTrailingOnes()); in TEST()
46 EXPECT_EQ(128u, Minus1.countPopulation()); in TEST()
47 EXPECT_EQ(-1, Minus1.getSExtValue()); in TEST()
55 EXPECT_EQ(0u, i33minus2.countLeadingZeros()); in TEST()
56 EXPECT_EQ(32u, i33minus2.countLeadingOnes()); in TEST()
57 EXPECT_EQ(33u, i33minus2.getActiveBits()); in TEST()
58 EXPECT_EQ(1u, i33minus2.countTrailingZeros()); in TEST()
59 EXPECT_EQ(32u, i33minus2.countPopulation()); in TEST()
60 EXPECT_EQ(-2, i33minus2.getSExtValue()); in TEST()
61 EXPECT_EQ(((uint64_t)-2)&((1ull<<33) -1), i33minus2.getZExtValue()); in TEST()
68 EXPECT_EQ(65u, i65.countLeadingZeros()); in TEST()
69 EXPECT_EQ(0u, i65.countLeadingOnes()); in TEST()
70 EXPECT_EQ(0u, i65.getActiveBits()); in TEST()
71 EXPECT_EQ(1u, i65.getActiveWords()); in TEST()
72 EXPECT_EQ(65u, i65.countTrailingZeros()); in TEST()
73 EXPECT_EQ(0u, i65.countPopulation()); in TEST()
77 EXPECT_EQ(0u, i65minus.countLeadingZeros()); in TEST()
78 EXPECT_EQ(1u, i65minus.countLeadingOnes()); in TEST()
79 EXPECT_EQ(65u, i65minus.getActiveBits()); in TEST()
80 EXPECT_EQ(64u, i65minus.countTrailingZeros()); in TEST()
81 EXPECT_EQ(1u, i65minus.countPopulation()); in TEST()
86 EXPECT_EQ(128u, u128max.countLeadingOnes()); in TEST()
87 EXPECT_EQ(0u, u128max.countLeadingZeros()); in TEST()
88 EXPECT_EQ(128u, u128max.getActiveBits()); in TEST()
89 EXPECT_EQ(0u, u128max.countTrailingZeros()); in TEST()
90 EXPECT_EQ(128u, u128max.countTrailingOnes()); in TEST()
91 EXPECT_EQ(128u, u128max.countPopulation()); in TEST()
94 EXPECT_EQ(64u, u64max.countLeadingZeros()); in TEST()
95 EXPECT_EQ(0u, u64max.countLeadingOnes()); in TEST()
96 EXPECT_EQ(64u, u64max.getActiveBits()); in TEST()
97 EXPECT_EQ(0u, u64max.countTrailingZeros()); in TEST()
98 EXPECT_EQ(64u, u64max.countTrailingOnes()); in TEST()
99 EXPECT_EQ(64u, u64max.countPopulation()); in TEST()
100 EXPECT_EQ((uint64_t)~0ull, u64max.getZExtValue()); in TEST()
103 EXPECT_EQ(128u, zero.countLeadingZeros()); in TEST()
104 EXPECT_EQ(0u, zero.countLeadingOnes()); in TEST()
105 EXPECT_EQ(0u, zero.getActiveBits()); in TEST()
106 EXPECT_EQ(128u, zero.countTrailingZeros()); in TEST()
107 EXPECT_EQ(0u, zero.countTrailingOnes()); in TEST()
108 EXPECT_EQ(0u, zero.countPopulation()); in TEST()
109 EXPECT_EQ(0u, zero.getSExtValue()); in TEST()
110 EXPECT_EQ(0u, zero.getZExtValue()); in TEST()
113 EXPECT_EQ(127u, one.countLeadingZeros()); in TEST()
114 EXPECT_EQ(0u, one.countLeadingOnes()); in TEST()
115 EXPECT_EQ(1u, one.getActiveBits()); in TEST()
116 EXPECT_EQ(0u, one.countTrailingZeros()); in TEST()
117 EXPECT_EQ(1u, one.countTrailingOnes()); in TEST()
118 EXPECT_EQ(1u, one.countPopulation()); in TEST()
119 EXPECT_EQ(1, one.getSExtValue()); in TEST()
120 EXPECT_EQ(1u, one.getZExtValue()); in TEST()
130 EXPECT_EQ(0, neg_two.getSExtValue()); in TEST()
131 EXPECT_EQ(-1, neg_one.getSExtValue()); in TEST()
132 EXPECT_EQ(1u, neg_one.getZExtValue()); in TEST()
133 EXPECT_EQ(0u, zero.getZExtValue()); in TEST()
134 EXPECT_EQ(-1, one.getSExtValue()); in TEST()
135 EXPECT_EQ(1u, one.getZExtValue()); in TEST()
136 EXPECT_EQ(0u, two.getZExtValue()); in TEST()
137 EXPECT_EQ(0, two.getSExtValue()); in TEST()
140 EXPECT_EQ(zero, two); in TEST()
141 EXPECT_EQ(zero, neg_two); in TEST()
142 EXPECT_EQ(one, neg_one); in TEST()
143 EXPECT_EQ(two, neg_two); in TEST()
152 EXPECT_EQ(two, one + one); in TEST()
153 EXPECT_EQ(zero, neg_one + one); in TEST()
154 EXPECT_EQ(neg_two, neg_one + neg_one); in TEST()
157 EXPECT_EQ(neg_two, neg_one - one); in TEST()
158 EXPECT_EQ(two, one - neg_one); in TEST()
159 EXPECT_EQ(zero, one - one); in TEST()
162 EXPECT_EQ(zero, one << one); in TEST()
163 EXPECT_EQ(one, one << zero); in TEST()
164 EXPECT_EQ(zero, one.shl(1)); in TEST()
165 EXPECT_EQ(one, one.shl(0)); in TEST()
166 EXPECT_EQ(zero, one.lshr(1)); in TEST()
167 EXPECT_EQ(zero, one.ashr(1)); in TEST()
170 EXPECT_EQ(one, one.rotl(0)); in TEST()
171 EXPECT_EQ(one, one.rotl(1)); in TEST()
172 EXPECT_EQ(one, one.rotr(0)); in TEST()
173 EXPECT_EQ(one, one.rotr(1)); in TEST()
176 EXPECT_EQ(neg_one, neg_one * one); in TEST()
177 EXPECT_EQ(neg_one, one * neg_one); in TEST()
178 EXPECT_EQ(one, neg_one * neg_one); in TEST()
179 EXPECT_EQ(one, one * one); in TEST()
182 EXPECT_EQ(neg_one, one.sdiv(neg_one)); in TEST()
183 EXPECT_EQ(neg_one, neg_one.sdiv(one)); in TEST()
184 EXPECT_EQ(one, neg_one.sdiv(neg_one)); in TEST()
185 EXPECT_EQ(one, one.sdiv(one)); in TEST()
187 EXPECT_EQ(neg_one, one.udiv(neg_one)); in TEST()
188 EXPECT_EQ(neg_one, neg_one.udiv(one)); in TEST()
189 EXPECT_EQ(one, neg_one.udiv(neg_one)); in TEST()
190 EXPECT_EQ(one, one.udiv(one)); in TEST()
193 EXPECT_EQ(zero, neg_one.srem(one)); in TEST()
194 EXPECT_EQ(zero, neg_one.urem(one)); in TEST()
195 EXPECT_EQ(zero, one.srem(neg_one)); in TEST()
206 EXPECT_EQ(nine.srem(two), one); in TEST()
207 EXPECT_EQ(nine.srem(-two), one); in TEST()
208 EXPECT_EQ((-nine).srem(two), -one); in TEST()
209 EXPECT_EQ((-nine).srem(-two), -one); in TEST()
212 EXPECT_EQ(four, q); in TEST()
213 EXPECT_EQ(one, r); in TEST()
215 EXPECT_EQ(-four, q); in TEST()
216 EXPECT_EQ(-one, r); in TEST()
218 EXPECT_EQ(-four, q); in TEST()
219 EXPECT_EQ(one, r); in TEST()
221 EXPECT_EQ(four, q); in TEST()
222 EXPECT_EQ(-one, r); in TEST()
242 EXPECT_EQ(uv1 < uv2, arg1.ult(arg2)); in TEST()
243 EXPECT_EQ(uv1 <= uv2, arg1.ule(arg2)); in TEST()
244 EXPECT_EQ(uv1 > uv2, arg1.ugt(arg2)); in TEST()
245 EXPECT_EQ(uv1 >= uv2, arg1.uge(arg2)); in TEST()
247 EXPECT_EQ(sv1 < sv2, arg1.slt(arg2)); in TEST()
248 EXPECT_EQ(sv1 <= sv2, arg1.sle(arg2)); in TEST()
249 EXPECT_EQ(sv1 > sv2, arg1.sgt(arg2)); in TEST()
250 EXPECT_EQ(sv1 >= sv2, arg1.sge(arg2)); in TEST()
252 EXPECT_EQ(uv1 < uv2, arg1.ult(uv2)); in TEST()
253 EXPECT_EQ(uv1 <= uv2, arg1.ule(uv2)); in TEST()
254 EXPECT_EQ(uv1 > uv2, arg1.ugt(uv2)); in TEST()
255 EXPECT_EQ(uv1 >= uv2, arg1.uge(uv2)); in TEST()
257 EXPECT_EQ(sv1 < sv2, arg1.slt(sv2)); in TEST()
258 EXPECT_EQ(sv1 <= sv2, arg1.sle(sv2)); in TEST()
259 EXPECT_EQ(sv1 > sv2, arg1.sgt(sv2)); in TEST()
260 EXPECT_EQ(sv1 >= sv2, arg1.sge(sv2)); in TEST()
429 EXPECT_EQ(b, q); in testDiv()
430 EXPECT_EQ(c, r); in testDiv()
432 EXPECT_EQ(b, q); in testDiv()
433 EXPECT_EQ(c, r); in testDiv()
436 EXPECT_EQ(b, q); in testDiv()
437 EXPECT_EQ(c, r); in testDiv()
439 EXPECT_EQ(b, q); in testDiv()
440 EXPECT_EQ(c, r); in testDiv()
445 EXPECT_EQ(a, q); in testDiv()
446 EXPECT_EQ(c, r); in testDiv()
448 EXPECT_EQ(a, q); in testDiv()
449 EXPECT_EQ(c, r); in testDiv()
452 EXPECT_EQ(a, q); in testDiv()
453 EXPECT_EQ(c, r); in testDiv()
455 EXPECT_EQ(a, q); in testDiv()
456 EXPECT_EQ(c, r); in testDiv()
517 EXPECT_EQ(APInt(32, 0), APInt(32, "0", 2)); in TEST()
518 EXPECT_EQ(APInt(32, 1), APInt(32, "1", 2)); in TEST()
519 EXPECT_EQ(APInt(32, 2), APInt(32, "10", 2)); in TEST()
520 EXPECT_EQ(APInt(32, 3), APInt(32, "11", 2)); in TEST()
521 EXPECT_EQ(APInt(32, 4), APInt(32, "100", 2)); in TEST()
523 EXPECT_EQ(APInt(32, 0), APInt(32, "+0", 2)); in TEST()
524 EXPECT_EQ(APInt(32, 1), APInt(32, "+1", 2)); in TEST()
525 EXPECT_EQ(APInt(32, 2), APInt(32, "+10", 2)); in TEST()
526 EXPECT_EQ(APInt(32, 3), APInt(32, "+11", 2)); in TEST()
527 EXPECT_EQ(APInt(32, 4), APInt(32, "+100", 2)); in TEST()
529 EXPECT_EQ(APInt(32, uint64_t(-0LL)), APInt(32, "-0", 2)); in TEST()
530 EXPECT_EQ(APInt(32, uint64_t(-1LL)), APInt(32, "-1", 2)); in TEST()
531 EXPECT_EQ(APInt(32, uint64_t(-2LL)), APInt(32, "-10", 2)); in TEST()
532 EXPECT_EQ(APInt(32, uint64_t(-3LL)), APInt(32, "-11", 2)); in TEST()
533 EXPECT_EQ(APInt(32, uint64_t(-4LL)), APInt(32, "-100", 2)); in TEST()
536 EXPECT_EQ(APInt(32, 0), APInt(32, "0", 8)); in TEST()
537 EXPECT_EQ(APInt(32, 1), APInt(32, "1", 8)); in TEST()
538 EXPECT_EQ(APInt(32, 7), APInt(32, "7", 8)); in TEST()
539 EXPECT_EQ(APInt(32, 8), APInt(32, "10", 8)); in TEST()
540 EXPECT_EQ(APInt(32, 15), APInt(32, "17", 8)); in TEST()
541 EXPECT_EQ(APInt(32, 16), APInt(32, "20", 8)); in TEST()
543 EXPECT_EQ(APInt(32, +0), APInt(32, "+0", 8)); in TEST()
544 EXPECT_EQ(APInt(32, +1), APInt(32, "+1", 8)); in TEST()
545 EXPECT_EQ(APInt(32, +7), APInt(32, "+7", 8)); in TEST()
546 EXPECT_EQ(APInt(32, +8), APInt(32, "+10", 8)); in TEST()
547 EXPECT_EQ(APInt(32, +15), APInt(32, "+17", 8)); in TEST()
548 EXPECT_EQ(APInt(32, +16), APInt(32, "+20", 8)); in TEST()
550 EXPECT_EQ(APInt(32, uint64_t(-0LL)), APInt(32, "-0", 8)); in TEST()
551 EXPECT_EQ(APInt(32, uint64_t(-1LL)), APInt(32, "-1", 8)); in TEST()
552 EXPECT_EQ(APInt(32, uint64_t(-7LL)), APInt(32, "-7", 8)); in TEST()
553 EXPECT_EQ(APInt(32, uint64_t(-8LL)), APInt(32, "-10", 8)); in TEST()
554 EXPECT_EQ(APInt(32, uint64_t(-15LL)), APInt(32, "-17", 8)); in TEST()
555 EXPECT_EQ(APInt(32, uint64_t(-16LL)), APInt(32, "-20", 8)); in TEST()
558 EXPECT_EQ(APInt(32, 0), APInt(32, "0", 10)); in TEST()
559 EXPECT_EQ(APInt(32, 1), APInt(32, "1", 10)); in TEST()
560 EXPECT_EQ(APInt(32, 9), APInt(32, "9", 10)); in TEST()
561 EXPECT_EQ(APInt(32, 10), APInt(32, "10", 10)); in TEST()
562 EXPECT_EQ(APInt(32, 19), APInt(32, "19", 10)); in TEST()
563 EXPECT_EQ(APInt(32, 20), APInt(32, "20", 10)); in TEST()
565 EXPECT_EQ(APInt(32, uint64_t(-0LL)), APInt(32, "-0", 10)); in TEST()
566 EXPECT_EQ(APInt(32, uint64_t(-1LL)), APInt(32, "-1", 10)); in TEST()
567 EXPECT_EQ(APInt(32, uint64_t(-9LL)), APInt(32, "-9", 10)); in TEST()
568 EXPECT_EQ(APInt(32, uint64_t(-10LL)), APInt(32, "-10", 10)); in TEST()
569 EXPECT_EQ(APInt(32, uint64_t(-19LL)), APInt(32, "-19", 10)); in TEST()
570 EXPECT_EQ(APInt(32, uint64_t(-20LL)), APInt(32, "-20", 10)); in TEST()
573 EXPECT_EQ(APInt(32, 0), APInt(32, "0", 16)); in TEST()
574 EXPECT_EQ(APInt(32, 1), APInt(32, "1", 16)); in TEST()
575 EXPECT_EQ(APInt(32, 15), APInt(32, "F", 16)); in TEST()
576 EXPECT_EQ(APInt(32, 16), APInt(32, "10", 16)); in TEST()
577 EXPECT_EQ(APInt(32, 31), APInt(32, "1F", 16)); in TEST()
578 EXPECT_EQ(APInt(32, 32), APInt(32, "20", 16)); in TEST()
580 EXPECT_EQ(APInt(32, uint64_t(-0LL)), APInt(32, "-0", 16)); in TEST()
581 EXPECT_EQ(APInt(32, uint64_t(-1LL)), APInt(32, "-1", 16)); in TEST()
582 EXPECT_EQ(APInt(32, uint64_t(-15LL)), APInt(32, "-F", 16)); in TEST()
583 EXPECT_EQ(APInt(32, uint64_t(-16LL)), APInt(32, "-10", 16)); in TEST()
584 EXPECT_EQ(APInt(32, uint64_t(-31LL)), APInt(32, "-1F", 16)); in TEST()
585 EXPECT_EQ(APInt(32, uint64_t(-32LL)), APInt(32, "-20", 16)); in TEST()
587 EXPECT_EQ(APInt(32, 0), APInt(32, "0", 36)); in TEST()
588 EXPECT_EQ(APInt(32, 1), APInt(32, "1", 36)); in TEST()
589 EXPECT_EQ(APInt(32, 35), APInt(32, "Z", 36)); in TEST()
590 EXPECT_EQ(APInt(32, 36), APInt(32, "10", 36)); in TEST()
591 EXPECT_EQ(APInt(32, 71), APInt(32, "1Z", 36)); in TEST()
592 EXPECT_EQ(APInt(32, 72), APInt(32, "20", 36)); in TEST()
594 EXPECT_EQ(APInt(32, uint64_t(-0LL)), APInt(32, "-0", 36)); in TEST()
595 EXPECT_EQ(APInt(32, uint64_t(-1LL)), APInt(32, "-1", 36)); in TEST()
596 EXPECT_EQ(APInt(32, uint64_t(-35LL)), APInt(32, "-Z", 36)); in TEST()
597 EXPECT_EQ(APInt(32, uint64_t(-36LL)), APInt(32, "-10", 36)); in TEST()
598 EXPECT_EQ(APInt(32, uint64_t(-71LL)), APInt(32, "-1Z", 36)); in TEST()
599 EXPECT_EQ(APInt(32, uint64_t(-72LL)), APInt(32, "-20", 36)); in TEST()
603 EXPECT_EQ(APInt(32, uint64_t(1)), APInt(32, ArrayRef<uint64_t>(1))); in TEST()
607 EXPECT_EQ(1U, APInt::getBitsNeeded( "0", 2)); in TEST()
608 EXPECT_EQ(1U, APInt::getBitsNeeded( "1", 2)); in TEST()
609 EXPECT_EQ(2U, APInt::getBitsNeeded( "10", 2)); in TEST()
610 EXPECT_EQ(2U, APInt::getBitsNeeded( "11", 2)); in TEST()
611 EXPECT_EQ(3U, APInt::getBitsNeeded("100", 2)); in TEST()
613 EXPECT_EQ(1U, APInt::getBitsNeeded( "+0", 2)); in TEST()
614 EXPECT_EQ(1U, APInt::getBitsNeeded( "+1", 2)); in TEST()
615 EXPECT_EQ(2U, APInt::getBitsNeeded( "+10", 2)); in TEST()
616 EXPECT_EQ(2U, APInt::getBitsNeeded( "+11", 2)); in TEST()
617 EXPECT_EQ(3U, APInt::getBitsNeeded("+100", 2)); in TEST()
619 EXPECT_EQ(2U, APInt::getBitsNeeded( "-0", 2)); in TEST()
620 EXPECT_EQ(2U, APInt::getBitsNeeded( "-1", 2)); in TEST()
621 EXPECT_EQ(3U, APInt::getBitsNeeded( "-10", 2)); in TEST()
622 EXPECT_EQ(3U, APInt::getBitsNeeded( "-11", 2)); in TEST()
623 EXPECT_EQ(4U, APInt::getBitsNeeded("-100", 2)); in TEST()
627 EXPECT_EQ(3U, APInt::getBitsNeeded( "0", 8)); in TEST()
628 EXPECT_EQ(3U, APInt::getBitsNeeded( "7", 8)); in TEST()
629 EXPECT_EQ(6U, APInt::getBitsNeeded("10", 8)); in TEST()
630 EXPECT_EQ(6U, APInt::getBitsNeeded("17", 8)); in TEST()
631 EXPECT_EQ(6U, APInt::getBitsNeeded("20", 8)); in TEST()
633 EXPECT_EQ(3U, APInt::getBitsNeeded( "+0", 8)); in TEST()
634 EXPECT_EQ(3U, APInt::getBitsNeeded( "+7", 8)); in TEST()
635 EXPECT_EQ(6U, APInt::getBitsNeeded("+10", 8)); in TEST()
636 EXPECT_EQ(6U, APInt::getBitsNeeded("+17", 8)); in TEST()
637 EXPECT_EQ(6U, APInt::getBitsNeeded("+20", 8)); in TEST()
639 EXPECT_EQ(4U, APInt::getBitsNeeded( "-0", 8)); in TEST()
640 EXPECT_EQ(4U, APInt::getBitsNeeded( "-7", 8)); in TEST()
641 EXPECT_EQ(7U, APInt::getBitsNeeded("-10", 8)); in TEST()
642 EXPECT_EQ(7U, APInt::getBitsNeeded("-17", 8)); in TEST()
643 EXPECT_EQ(7U, APInt::getBitsNeeded("-20", 8)); in TEST()
647 EXPECT_EQ(1U, APInt::getBitsNeeded( "0", 10)); in TEST()
648 EXPECT_EQ(2U, APInt::getBitsNeeded( "3", 10)); in TEST()
649 EXPECT_EQ(4U, APInt::getBitsNeeded( "9", 10)); in TEST()
650 EXPECT_EQ(4U, APInt::getBitsNeeded("10", 10)); in TEST()
651 EXPECT_EQ(5U, APInt::getBitsNeeded("19", 10)); in TEST()
652 EXPECT_EQ(5U, APInt::getBitsNeeded("20", 10)); in TEST()
654 EXPECT_EQ(1U, APInt::getBitsNeeded( "+0", 10)); in TEST()
655 EXPECT_EQ(4U, APInt::getBitsNeeded( "+9", 10)); in TEST()
656 EXPECT_EQ(4U, APInt::getBitsNeeded("+10", 10)); in TEST()
657 EXPECT_EQ(5U, APInt::getBitsNeeded("+19", 10)); in TEST()
658 EXPECT_EQ(5U, APInt::getBitsNeeded("+20", 10)); in TEST()
660 EXPECT_EQ(2U, APInt::getBitsNeeded( "-0", 10)); in TEST()
661 EXPECT_EQ(5U, APInt::getBitsNeeded( "-9", 10)); in TEST()
662 EXPECT_EQ(5U, APInt::getBitsNeeded("-10", 10)); in TEST()
663 EXPECT_EQ(6U, APInt::getBitsNeeded("-19", 10)); in TEST()
664 EXPECT_EQ(6U, APInt::getBitsNeeded("-20", 10)); in TEST()
668 EXPECT_EQ(4U, APInt::getBitsNeeded( "0", 16)); in TEST()
669 EXPECT_EQ(4U, APInt::getBitsNeeded( "F", 16)); in TEST()
670 EXPECT_EQ(8U, APInt::getBitsNeeded("10", 16)); in TEST()
671 EXPECT_EQ(8U, APInt::getBitsNeeded("1F", 16)); in TEST()
672 EXPECT_EQ(8U, APInt::getBitsNeeded("20", 16)); in TEST()
674 EXPECT_EQ(4U, APInt::getBitsNeeded( "+0", 16)); in TEST()
675 EXPECT_EQ(4U, APInt::getBitsNeeded( "+F", 16)); in TEST()
676 EXPECT_EQ(8U, APInt::getBitsNeeded("+10", 16)); in TEST()
677 EXPECT_EQ(8U, APInt::getBitsNeeded("+1F", 16)); in TEST()
678 EXPECT_EQ(8U, APInt::getBitsNeeded("+20", 16)); in TEST()
680 EXPECT_EQ(5U, APInt::getBitsNeeded( "-0", 16)); in TEST()
681 EXPECT_EQ(5U, APInt::getBitsNeeded( "-F", 16)); in TEST()
682 EXPECT_EQ(9U, APInt::getBitsNeeded("-10", 16)); in TEST()
683 EXPECT_EQ(9U, APInt::getBitsNeeded("-1F", 16)); in TEST()
684 EXPECT_EQ(9U, APInt::getBitsNeeded("-20", 16)); in TEST()
692 EXPECT_EQ(S.str().str(), "0b0"); in TEST()
695 EXPECT_EQ(S.str().str(), "00"); in TEST()
698 EXPECT_EQ(S.str().str(), "0"); in TEST()
701 EXPECT_EQ(S.str().str(), "0x0"); in TEST()
704 EXPECT_EQ(S.str().str(), "0"); in TEST()
709 EXPECT_EQ(S.str().str(), "0b11111111"); in TEST()
712 EXPECT_EQ(S.str().str(), "0377"); in TEST()
715 EXPECT_EQ(S.str().str(), "255"); in TEST()
718 EXPECT_EQ(S.str().str(), "0xFF"); in TEST()
721 EXPECT_EQ(S.str().str(), "73"); in TEST()
726 EXPECT_EQ(S.str().str(), "-0b1"); in TEST()
729 EXPECT_EQ(S.str().str(), "-01"); in TEST()
732 EXPECT_EQ(S.str().str(), "-1"); in TEST()
735 EXPECT_EQ(S.str().str(), "-0x1"); in TEST()
738 EXPECT_EQ(S.str().str(), "-1"); in TEST()
743 EXPECT_EQ(APInt(15, 7).logBase2(), 2U); in TEST()
744 EXPECT_EQ(APInt(15, 7).ceilLogBase2(), 3U); in TEST()
745 EXPECT_EQ(APInt(15, 7).exactLogBase2(), -1); in TEST()
746 EXPECT_EQ(APInt(15, 8).logBase2(), 3U); in TEST()
747 EXPECT_EQ(APInt(15, 8).ceilLogBase2(), 3U); in TEST()
748 EXPECT_EQ(APInt(15, 8).exactLogBase2(), 3); in TEST()
749 EXPECT_EQ(APInt(15, 9).logBase2(), 3U); in TEST()
750 EXPECT_EQ(APInt(15, 9).ceilLogBase2(), 4U); in TEST()
751 EXPECT_EQ(APInt(15, 9).exactLogBase2(), -1); in TEST()
755 EXPECT_EQ(APInt(32, 3).magic().m, APInt(32, "55555556", 16)); in TEST()
756 EXPECT_EQ(APInt(32, 3).magic().s, 0U); in TEST()
757 EXPECT_EQ(APInt(32, 5).magic().m, APInt(32, "66666667", 16)); in TEST()
758 EXPECT_EQ(APInt(32, 5).magic().s, 1U); in TEST()
759 EXPECT_EQ(APInt(32, 7).magic().m, APInt(32, "92492493", 16)); in TEST()
760 EXPECT_EQ(APInt(32, 7).magic().s, 2U); in TEST()
764 EXPECT_EQ(APInt(32, 3).magicu().m, APInt(32, "AAAAAAAB", 16)); in TEST()
765 EXPECT_EQ(APInt(32, 3).magicu().s, 1U); in TEST()
766 EXPECT_EQ(APInt(32, 5).magicu().m, APInt(32, "CCCCCCCD", 16)); in TEST()
767 EXPECT_EQ(APInt(32, 5).magicu().s, 2U); in TEST()
768 EXPECT_EQ(APInt(32, 7).magicu().m, APInt(32, "24924925", 16)); in TEST()
769 EXPECT_EQ(APInt(32, 7).magicu().s, 3U); in TEST()
770 EXPECT_EQ(APInt(64, 25).magicu(1).m, APInt(64, "A3D70A3D70A3D70B", 16)); in TEST()
771 EXPECT_EQ(APInt(64, 25).magicu(1).s, 4U); in TEST()
796 EXPECT_EQ(ValA.toString(10, false), ValC.toString(10, false)); in TEST()
800 EXPECT_EQ(APInt(8, 1), APInt(8, 1).rotl(0)); in TEST()
801 EXPECT_EQ(APInt(8, 2), APInt(8, 1).rotl(1)); in TEST()
802 EXPECT_EQ(APInt(8, 4), APInt(8, 1).rotl(2)); in TEST()
803 EXPECT_EQ(APInt(8, 16), APInt(8, 1).rotl(4)); in TEST()
804 EXPECT_EQ(APInt(8, 1), APInt(8, 1).rotl(8)); in TEST()
806 EXPECT_EQ(APInt(8, 16), APInt(8, 16).rotl(0)); in TEST()
807 EXPECT_EQ(APInt(8, 32), APInt(8, 16).rotl(1)); in TEST()
808 EXPECT_EQ(APInt(8, 64), APInt(8, 16).rotl(2)); in TEST()
809 EXPECT_EQ(APInt(8, 1), APInt(8, 16).rotl(4)); in TEST()
810 EXPECT_EQ(APInt(8, 16), APInt(8, 16).rotl(8)); in TEST()
812 EXPECT_EQ(APInt(8, 16), APInt(8, 16).rotr(0)); in TEST()
813 EXPECT_EQ(APInt(8, 8), APInt(8, 16).rotr(1)); in TEST()
814 EXPECT_EQ(APInt(8, 4), APInt(8, 16).rotr(2)); in TEST()
815 EXPECT_EQ(APInt(8, 1), APInt(8, 16).rotr(4)); in TEST()
816 EXPECT_EQ(APInt(8, 16), APInt(8, 16).rotr(8)); in TEST()
818 EXPECT_EQ(APInt(8, 1), APInt(8, 1).rotr(0)); in TEST()
819 EXPECT_EQ(APInt(8, 128), APInt(8, 1).rotr(1)); in TEST()
820 EXPECT_EQ(APInt(8, 64), APInt(8, 1).rotr(2)); in TEST()
821 EXPECT_EQ(APInt(8, 16), APInt(8, 1).rotr(4)); in TEST()
822 EXPECT_EQ(APInt(8, 1), APInt(8, 1).rotr(8)); in TEST()
826 EXPECT_EQ(Rot, Big.rotr(144)); in TEST()
831 EXPECT_EQ(ValA, APInt::getSplat(8, ValA)); in TEST()
832 EXPECT_EQ(APInt(64, 0x0101010101010101ULL), APInt::getSplat(64, ValA)); in TEST()
835 EXPECT_EQ(APInt(4, 0xD), APInt::getSplat(4, ValB)); in TEST()
836 EXPECT_EQ(APInt(15, 0xDB6D), APInt::getSplat(15, ValB)); in TEST()
846 EXPECT_EQ(carry, integerPart(0)); in TEST()
847 EXPECT_EQ(singleWord, ~integerPart(0) >> 1); in TEST()
854 EXPECT_EQ(carry, integerPart(1)); in TEST()
855 EXPECT_EQ(singleWord, ~integerPart(0)); in TEST()
865 EXPECT_EQ(APInt::tcCompare(test, expected, 4), 0); in TEST()
873 EXPECT_EQ(carry, integerPart(0)); in TEST()
874 EXPECT_EQ(APInt::tcCompare(test, expected, 4), 0); in TEST()
882 EXPECT_EQ(carry, integerPart(0)); in TEST()
883 EXPECT_EQ(APInt::tcCompare(test, expected, 4), 0); in TEST()
891 EXPECT_EQ(carry, integerPart(0)); in TEST()
892 EXPECT_EQ(APInt::tcCompare(test, expected, 4), 0); in TEST()
900 EXPECT_EQ(carry, integerPart(1)); in TEST()
901 EXPECT_EQ(APInt::tcCompare(test, expected, 4), 0); in TEST()
910 EXPECT_EQ(bool(E1 & (1ULL << i)), in TEST()
924 EXPECT_EQ(bool(E2[i] & (1ULL << j)), in TEST()
944 EXPECT_EQ(A1.nearestLogBase2(), A1.ceilLogBase2()); in TEST()
949 EXPECT_EQ(A2.nearestLogBase2(), A2.logBase2()); in TEST()
954 EXPECT_EQ(A3.nearestLogBase2(), A3.ceilLogBase2()); in TEST()
961 EXPECT_EQ(A4.nearestLogBase2(), A4.ceilLogBase2()); in TEST()
966 EXPECT_EQ(A5.nearestLogBase2(), A5.logBase2()); in TEST()
971 EXPECT_EQ(A6.nearestLogBase2(), A6.ceilLogBase2()); in TEST()
975 EXPECT_EQ(A7.nearestLogBase2(), 0ULL); in TEST()
977 EXPECT_EQ(A8.nearestLogBase2(), UINT32_MAX); in TEST()
982 EXPECT_EQ(A9.nearestLogBase2(), UINT32_MAX); in TEST()
1053 EXPECT_EQ(32u, X.getBitWidth()); in TEST()
1054 EXPECT_EQ(0xdeadbeefULL, X.getLimitedValue()); in TEST()
1059 EXPECT_EQ(128u, Y.getBitWidth()); in TEST()
1060 EXPECT_EQ(~0ULL, Y.getLimitedValue()); in TEST()
1062 EXPECT_EQ(2u, Y.getNumWords()); in TEST()
1063 EXPECT_EQ(0xdeadbeefdeadbeefULL, Raw[0]); in TEST()
1064 EXPECT_EQ(0xdeadbeefdeadbeefULL, Raw[1]); in TEST()
1073 EXPECT_EQ(1, APInt(1, 1).reverseBits()); in TEST()
1074 EXPECT_EQ(0, APInt(1, 0).reverseBits()); in TEST()
1076 EXPECT_EQ(3, APInt(2, 3).reverseBits()); in TEST()
1077 EXPECT_EQ(3, APInt(2, 3).reverseBits()); in TEST()
1079 EXPECT_EQ(0xb, APInt(4, 0xd).reverseBits()); in TEST()
1080 EXPECT_EQ(0xd, APInt(4, 0xb).reverseBits()); in TEST()
1081 EXPECT_EQ(0xf, APInt(4, 0xf).reverseBits()); in TEST()
1083 EXPECT_EQ(0x30, APInt(7, 0x6).reverseBits()); in TEST()
1084 EXPECT_EQ(0x5a, APInt(7, 0x2d).reverseBits()); in TEST()
1086 EXPECT_EQ(0x0f, APInt(8, 0xf0).reverseBits()); in TEST()
1087 EXPECT_EQ(0xf0, APInt(8, 0x0f).reverseBits()); in TEST()
1089 EXPECT_EQ(0x0f0f, APInt(16, 0xf0f0).reverseBits()); in TEST()
1090 EXPECT_EQ(0xf0f0, APInt(16, 0x0f0f).reverseBits()); in TEST()
1092 EXPECT_EQ(0x0f0f0f0f, APInt(32, 0xf0f0f0f0).reverseBits()); in TEST()
1093 EXPECT_EQ(0xf0f0f0f0, APInt(32, 0x0f0f0f0f).reverseBits()); in TEST()
1095 EXPECT_EQ(0x402880a0 >> 1, APInt(31, 0x05011402).reverseBits()); in TEST()
1097 EXPECT_EQ(0x0f0f0f0f, APInt(32, 0xf0f0f0f0).reverseBits()); in TEST()
1098 EXPECT_EQ(0xf0f0f0f0, APInt(32, 0x0f0f0f0f).reverseBits()); in TEST()
1100 EXPECT_EQ(0x0f0f0f0f0f0f0f0f, APInt(64, 0xf0f0f0f0f0f0f0f0).reverseBits()); in TEST()
1101 EXPECT_EQ(0xf0f0f0f0f0f0f0f0, APInt(64, 0x0f0f0f0f0f0f0f0f).reverseBits()); in TEST()
1108 EXPECT_EQ(Y, X.reverseBits()); in TEST()
1109 EXPECT_EQ(X, Y.reverseBits()); in TEST()