@@ -412,19 +412,15 @@ TEST(KnownBitsTest, BinaryExhaustive) {
412
412
},
413
413
checkCorrectnessOnlyBinary);
414
414
testBinaryOpExhaustive (
415
- [](const KnownBits &Known1, const KnownBits &Known2) {
416
- return KnownBits::urem (Known1, Known2);
417
- },
415
+ KnownBits::urem,
418
416
[](const APInt &N1, const APInt &N2) -> std::optional<APInt> {
419
417
if (N2.isZero ())
420
418
return std::nullopt;
421
419
return N1.urem (N2);
422
420
},
423
421
checkCorrectnessOnlyBinary);
424
422
testBinaryOpExhaustive (
425
- [](const KnownBits &Known1, const KnownBits &Known2) {
426
- return KnownBits::srem (Known1, Known2);
427
- },
423
+ KnownBits::srem,
428
424
[](const APInt &N1, const APInt &N2) -> std::optional<APInt> {
429
425
if (N2.isZero ())
430
426
return std::nullopt;
@@ -556,18 +552,14 @@ TEST(KnownBitsTest, BinaryExhaustive) {
556
552
[](const APInt &N1, const APInt &N2) { return N1 * N2; },
557
553
checkCorrectnessOnlyBinary);
558
554
testBinaryOpExhaustive (
559
- [](const KnownBits &Known1, const KnownBits &Known2) {
560
- return KnownBits::mulhs (Known1, Known2);
561
- },
555
+ KnownBits::mulhs,
562
556
[](const APInt &N1, const APInt &N2) {
563
557
unsigned Bits = N1.getBitWidth ();
564
558
return (N1.sext (2 * Bits) * N2.sext (2 * Bits)).extractBits (Bits, Bits);
565
559
},
566
560
checkCorrectnessOnlyBinary);
567
561
testBinaryOpExhaustive (
568
- [](const KnownBits &Known1, const KnownBits &Known2) {
569
- return KnownBits::mulhu (Known1, Known2);
570
- },
562
+ KnownBits::mulhu,
571
563
[](const APInt &N1, const APInt &N2) {
572
564
unsigned Bits = N1.getBitWidth ();
573
565
return (N1.zext (2 * Bits) * N2.zext (2 * Bits)).extractBits (Bits, Bits);
0 commit comments