From 3ba292dbc2acee2d1052fb7ffe332e2164147b47 Mon Sep 17 00:00:00 2001 From: Jeffrey Yasskin Date: Mon, 18 Jul 2011 21:45:40 +0000 Subject: Add APInt(numBits, ArrayRef 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 --- unittests/ADT/APIntTest.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'unittests') 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(1))); +} + TEST(APIntTest, StringBitsNeeded2) { EXPECT_EQ(1U, APInt::getBitsNeeded( "0", 2)); EXPECT_EQ(1U, APInt::getBitsNeeded( "1", 2)); -- cgit v1.2.3-18-g5258