diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2011-03-17 20:39:06 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2011-03-17 20:39:06 +0000 |
commit | d9103df51b858cf051a1650ac7eb33d416e9ac41 (patch) | |
tree | 8b6f8e90439018b65d736d50ca4c8cb9b9b206d2 /unittests | |
parent | 6a3dbd3b25bbc99bd1a233d6a74ddea3493ba6ac (diff) | |
download | llvm-d9103df51b858cf051a1650ac7eb33d416e9ac41.tar.gz llvm-d9103df51b858cf051a1650ac7eb33d416e9ac41.tar.bz2 llvm-d9103df51b858cf051a1650ac7eb33d416e9ac41.tar.xz |
Add an argument to APInt's magic udiv calculation to specify the number of bits that are known zero in the divided number.
This will come in handy soon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127828 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r-- | unittests/ADT/APIntTest.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/unittests/ADT/APIntTest.cpp b/unittests/ADT/APIntTest.cpp index e05bdbfc71..dbd0cb7a24 100644 --- a/unittests/ADT/APIntTest.cpp +++ b/unittests/ADT/APIntTest.cpp @@ -348,6 +348,8 @@ TEST(APIntTest, magicu) { EXPECT_EQ(APInt(32, 5).magicu().s, 2U); EXPECT_EQ(APInt(32, 7).magicu().m, APInt(32, "24924925", 16)); EXPECT_EQ(APInt(32, 7).magicu().s, 3U); + EXPECT_EQ(APInt(64, 25).magicu(1).m, APInt(64, "A3D70A3D70A3D70B", 16)); + EXPECT_EQ(APInt(64, 25).magicu(1).s, 4U); } #ifdef GTEST_HAS_DEATH_TEST |