aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/ADT/StringRefTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/unittests/ADT/StringRefTest.cpp')
-rw-r--r--llvm/unittests/ADT/StringRefTest.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/unittests/ADT/StringRefTest.cpp b/llvm/unittests/ADT/StringRefTest.cpp
index cad1974..a208527 100644
--- a/llvm/unittests/ADT/StringRefTest.cpp
+++ b/llvm/unittests/ADT/StringRefTest.cpp
@@ -818,6 +818,7 @@ TEST(StringRefTest, consumeIntegerUnsigned) {
uint16_t U16;
uint32_t U32;
uint64_t U64;
+ APInt U;
for (size_t i = 0; i < std::size(ConsumeUnsigned); ++i) {
StringRef Str = ConsumeUnsigned[i].Str;
@@ -858,6 +859,12 @@ TEST(StringRefTest, consumeIntegerUnsigned) {
ASSERT_FALSE(U64Success);
EXPECT_EQ(U64, ConsumeUnsigned[i].Expected);
EXPECT_EQ(Str, ConsumeUnsigned[i].Leftover);
+
+ Str = ConsumeUnsigned[i].Str;
+ U64Success = Str.consumeInteger(0, U);
+ ASSERT_FALSE(U64Success);
+ EXPECT_EQ(U.getZExtValue(), ConsumeUnsigned[i].Expected);
+ EXPECT_EQ(Str, ConsumeUnsigned[i].Leftover);
}
}