From 7a16288157efc5fb85fbe3b8b4c37071da7609a6 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. llvm-svn: 135431 --- llvm/unittests/ADT/APIntTest.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'llvm/unittests/ADT') diff --git a/llvm/unittests/ADT/APIntTest.cpp b/llvm/unittests/ADT/APIntTest.cpp index 1f78cd33bdf..c9b3bc51c13 100644 --- a/llvm/unittests/ADT/APIntTest.cpp +++ b/llvm/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