aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/ADT/APIntTest.cpp
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2023-05-31 10:16:16 +0200
committerNikita Popov <npopov@redhat.com>2023-05-31 17:13:48 +0200
commit42e98c6ae875e952ee852f78234c0f8ed311472b (patch)
treeddd9f121017663ab128330322e0737c5a3232a86 /llvm/unittests/ADT/APIntTest.cpp
parent3825910c7316cf62549bd31c503c48e7526adcc2 (diff)
downloadllvm-42e98c6ae875e952ee852f78234c0f8ed311472b.zip
llvm-42e98c6ae875e952ee852f78234c0f8ed311472b.tar.gz
llvm-42e98c6ae875e952ee852f78234c0f8ed311472b.tar.bz2
[APInt] Support zero-width extract in extractBitsAsZExtValue()
D111241 added support for extractBits() with zero width. Extend this to extractBitsAsZExtValue() as well for consistency (in which case it will always return zero). Differential Revision: https://reviews.llvm.org/D151788
Diffstat (limited to 'llvm/unittests/ADT/APIntTest.cpp')
-rw-r--r--llvm/unittests/ADT/APIntTest.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/unittests/ADT/APIntTest.cpp b/llvm/unittests/ADT/APIntTest.cpp
index b8cf48c..a9993ac 100644
--- a/llvm/unittests/ADT/APIntTest.cpp
+++ b/llvm/unittests/ADT/APIntTest.cpp
@@ -3052,6 +3052,7 @@ TEST(APIntTest, ZeroWidth) {
EXPECT_EQ(0U, APInt::getLowBitsSet(0, 0).getBitWidth());
EXPECT_EQ(0U, APInt::getSplat(0, ZW).getBitWidth());
EXPECT_EQ(0U, APInt(4, 10).extractBits(0, 2).getBitWidth());
+ EXPECT_EQ(0U, APInt(4, 10).extractBitsAsZExtValue(0, 2));
// Logical operators.
ZW |= ZW2;