diff options
| author | Jeffrey Yasskin <jyasskin@google.com> | 2011-07-18 21:45:40 +0000 |
|---|---|---|
| committer | Jeffrey Yasskin <jyasskin@google.com> | 2011-07-18 21:45:40 +0000 |
| commit | 7a16288157efc5fb85fbe3b8b4c37071da7609a6 (patch) | |
| tree | e52598e11fab758b3e30cabecb84072d3f5c64bb /llvm/unittests/ADT/APIntTest.cpp | |
| parent | 5de6a790f25f1ffd30d77008cf1d3ffa2db22e4d (diff) | |
| download | bcm5719-llvm-7a16288157efc5fb85fbe3b8b4c37071da7609a6.tar.gz bcm5719-llvm-7a16288157efc5fb85fbe3b8b4c37071da7609a6.zip | |
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.
llvm-svn: 135431
Diffstat (limited to 'llvm/unittests/ADT/APIntTest.cpp')
| -rw-r--r-- | llvm/unittests/ADT/APIntTest.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
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<uint64_t>(1))); +} + TEST(APIntTest, StringBitsNeeded2) { EXPECT_EQ(1U, APInt::getBitsNeeded( "0", 2)); EXPECT_EQ(1U, APInt::getBitsNeeded( "1", 2)); |

