summaryrefslogtreecommitdiff
path: root/unittests
diff options
context:
space:
mode:
authorJeffrey Yasskin <jyasskin@google.com>2011-07-18 21:45:40 +0000
committerJeffrey Yasskin <jyasskin@google.com>2011-07-18 21:45:40 +0000
commit3ba292dbc2acee2d1052fb7ffe332e2164147b47 (patch)
tree82c6c0d2c93837ac6383546b881dbcd10135f9cf /unittests
parent3a594f487628b4855d6394c99d5373891a46c797 (diff)
downloadllvm-3ba292dbc2acee2d1052fb7ffe332e2164147b47.tar.gz
llvm-3ba292dbc2acee2d1052fb7ffe332e2164147b47.tar.bz2
llvm-3ba292dbc2acee2d1052fb7ffe332e2164147b47.tar.xz
Add APInt(numBits, ArrayRef<uint64_t> bigVal) constructor to prevent future ambiguity
errors like the one corrected by r135261. Migrate all LLVM callers of the old constructor to the new one. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135431 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r--unittests/ADT/APIntTest.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/unittests/ADT/APIntTest.cpp b/unittests/ADT/APIntTest.cpp
index 1f78cd33bd..c9b3bc51c1 100644
--- a/unittests/ADT/APIntTest.cpp
+++ b/unittests/ADT/APIntTest.cpp
@@ -239,6 +239,10 @@ TEST(APIntTest, fromString) {
EXPECT_EQ(APInt(32, uint64_t(-32LL)), APInt(32, "-20", 16));
}
+TEST(APIntTest, FromArray) {
+ EXPECT_EQ(APInt(32, uint64_t(1)), APInt(32, ArrayRef<uint64_t>(1)));
+}
+
TEST(APIntTest, StringBitsNeeded2) {
EXPECT_EQ(1U, APInt::getBitsNeeded( "0", 2));
EXPECT_EQ(1U, APInt::getBitsNeeded( "1", 2));