aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Support/KnownBitsTest.cpp
diff options
context:
space:
mode:
authorJay Foad <jay.foad@amd.com>2024-03-19 07:04:36 +0000
committerJay Foad <jay.foad@amd.com>2024-03-19 07:06:15 +0000
commit110f630105aed0670d82427fea55afbabc4a94c4 (patch)
treec71d54abbf996b291fe42b41cda0147700d8bc2a /llvm/unittests/Support/KnownBitsTest.cpp
parentf0a5e5055029e9ab1c49a8580f09fa4c0e172ee1 (diff)
downloadllvm-110f630105aed0670d82427fea55afbabc4a94c4.zip
llvm-110f630105aed0670d82427fea55afbabc4a94c4.tar.gz
llvm-110f630105aed0670d82427fea55afbabc4a94c4.tar.bz2
[KnownBits] Remove useless lambdas from unit test
Diffstat (limited to 'llvm/unittests/Support/KnownBitsTest.cpp')
-rw-r--r--llvm/unittests/Support/KnownBitsTest.cpp16
1 files changed, 4 insertions, 12 deletions
diff --git a/llvm/unittests/Support/KnownBitsTest.cpp b/llvm/unittests/Support/KnownBitsTest.cpp
index b867b6c..48de088 100644
--- a/llvm/unittests/Support/KnownBitsTest.cpp
+++ b/llvm/unittests/Support/KnownBitsTest.cpp
@@ -412,9 +412,7 @@ TEST(KnownBitsTest, BinaryExhaustive) {
},
checkCorrectnessOnlyBinary);
testBinaryOpExhaustive(
- [](const KnownBits &Known1, const KnownBits &Known2) {
- return KnownBits::urem(Known1, Known2);
- },
+ KnownBits::urem,
[](const APInt &N1, const APInt &N2) -> std::optional<APInt> {
if (N2.isZero())
return std::nullopt;
@@ -422,9 +420,7 @@ TEST(KnownBitsTest, BinaryExhaustive) {
},
checkCorrectnessOnlyBinary);
testBinaryOpExhaustive(
- [](const KnownBits &Known1, const KnownBits &Known2) {
- return KnownBits::srem(Known1, Known2);
- },
+ KnownBits::srem,
[](const APInt &N1, const APInt &N2) -> std::optional<APInt> {
if (N2.isZero())
return std::nullopt;
@@ -556,18 +552,14 @@ TEST(KnownBitsTest, BinaryExhaustive) {
[](const APInt &N1, const APInt &N2) { return N1 * N2; },
checkCorrectnessOnlyBinary);
testBinaryOpExhaustive(
- [](const KnownBits &Known1, const KnownBits &Known2) {
- return KnownBits::mulhs(Known1, Known2);
- },
+ KnownBits::mulhs,
[](const APInt &N1, const APInt &N2) {
unsigned Bits = N1.getBitWidth();
return (N1.sext(2 * Bits) * N2.sext(2 * Bits)).extractBits(Bits, Bits);
},
checkCorrectnessOnlyBinary);
testBinaryOpExhaustive(
- [](const KnownBits &Known1, const KnownBits &Known2) {
- return KnownBits::mulhu(Known1, Known2);
- },
+ KnownBits::mulhu,
[](const APInt &N1, const APInt &N2) {
unsigned Bits = N1.getBitWidth();
return (N1.zext(2 * Bits) * N2.zext(2 * Bits)).extractBits(Bits, Bits);