aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/ADT/APIntTest.cpp
diff options
context:
space:
mode:
authorThomas Preud'homme <thomas.preudhomme@arm.com>2023-05-18 09:10:21 +0000
committerThomas Preud'homme <thomas.preudhomme@arm.com>2023-05-19 14:20:47 +0100
commita17083403fa1829d5a3ae11ca4d3e25213dc6e86 (patch)
tree92a7851d3bc4a3a0113e552ae8b575350cd1b0a2 /llvm/unittests/ADT/APIntTest.cpp
parent094ab4781262b6cb49d57b0ecdf84b047c879295 (diff)
downloadllvm-a17083403fa1829d5a3ae11ca4d3e25213dc6e86.zip
llvm-a17083403fa1829d5a3ae11ca4d3e25213dc6e86.tar.gz
llvm-a17083403fa1829d5a3ae11ca4d3e25213dc6e86.tar.bz2
Add control of hex casing in APInt::toString
This will be used in implementing arbitrary precision support to FileCheck's numeric variables and expressions. Reviewed By: foad, RKSimon Differential Revision: https://reviews.llvm.org/D150879
Diffstat (limited to 'llvm/unittests/ADT/APIntTest.cpp')
-rw-r--r--llvm/unittests/ADT/APIntTest.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/unittests/ADT/APIntTest.cpp b/llvm/unittests/ADT/APIntTest.cpp
index d8d7bfa..b8cf48c 100644
--- a/llvm/unittests/ADT/APIntTest.cpp
+++ b/llvm/unittests/ADT/APIntTest.cpp
@@ -1388,6 +1388,9 @@ TEST(APIntTest, toString) {
APInt(8, 255, isSigned).toString(S, 10, isSigned, true);
EXPECT_EQ(std::string(S), "255");
S.clear();
+ APInt(8, 255, isSigned).toString(S, 16, isSigned, true, /*UpperCase=*/false);
+ EXPECT_EQ(std::string(S), "0xff");
+ S.clear();
APInt(8, 255, isSigned).toString(S, 16, isSigned, true);
EXPECT_EQ(std::string(S), "0xFF");
S.clear();