Skip to content

Commit 110f630

Browse files
committed
[KnownBits] Remove useless lambdas from unit test
1 parent f0a5e50 commit 110f630

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

llvm/unittests/Support/KnownBitsTest.cpp

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -412,19 +412,15 @@ TEST(KnownBitsTest, BinaryExhaustive) {
412412
},
413413
checkCorrectnessOnlyBinary);
414414
testBinaryOpExhaustive(
415-
[](const KnownBits &Known1, const KnownBits &Known2) {
416-
return KnownBits::urem(Known1, Known2);
417-
},
415+
KnownBits::urem,
418416
[](const APInt &N1, const APInt &N2) -> std::optional<APInt> {
419417
if (N2.isZero())
420418
return std::nullopt;
421419
return N1.urem(N2);
422420
},
423421
checkCorrectnessOnlyBinary);
424422
testBinaryOpExhaustive(
425-
[](const KnownBits &Known1, const KnownBits &Known2) {
426-
return KnownBits::srem(Known1, Known2);
427-
},
423+
KnownBits::srem,
428424
[](const APInt &N1, const APInt &N2) -> std::optional<APInt> {
429425
if (N2.isZero())
430426
return std::nullopt;
@@ -556,18 +552,14 @@ TEST(KnownBitsTest, BinaryExhaustive) {
556552
[](const APInt &N1, const APInt &N2) { return N1 * N2; },
557553
checkCorrectnessOnlyBinary);
558554
testBinaryOpExhaustive(
559-
[](const KnownBits &Known1, const KnownBits &Known2) {
560-
return KnownBits::mulhs(Known1, Known2);
561-
},
555+
KnownBits::mulhs,
562556
[](const APInt &N1, const APInt &N2) {
563557
unsigned Bits = N1.getBitWidth();
564558
return (N1.sext(2 * Bits) * N2.sext(2 * Bits)).extractBits(Bits, Bits);
565559
},
566560
checkCorrectnessOnlyBinary);
567561
testBinaryOpExhaustive(
568-
[](const KnownBits &Known1, const KnownBits &Known2) {
569-
return KnownBits::mulhu(Known1, Known2);
570-
},
562+
KnownBits::mulhu,
571563
[](const APInt &N1, const APInt &N2) {
572564
unsigned Bits = N1.getBitWidth();
573565
return (N1.zext(2 * Bits) * N2.zext(2 * Bits)).extractBits(Bits, Bits);

0 commit comments

Comments
 (0)