diff options
author | Craig Topper <craig.topper@gmail.com> | 2017-04-24 05:38:26 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2017-04-24 05:38:26 +0000 |
commit | fc03d2d21f9f364b2d5ab41f42625a1c98eab351 (patch) | |
tree | d30fb88f74ee5aace8857b28b2ad021ba79f544d /llvm/unittests/ADT/APIntTest.cpp | |
parent | 4bac44c8054f30ace47088d7a22e992c02e6c12b (diff) | |
download | bcm5719-llvm-fc03d2d21f9f364b2d5ab41f42625a1c98eab351.tar.gz bcm5719-llvm-fc03d2d21f9f364b2d5ab41f42625a1c98eab351.zip |
[APInt] Make behavior of ashr by BitWidth consistent between single and multi word.
Previously single word would always return 0 regardless of the original sign. Multi word would return all 0s or all 1s based on the original sign. Now single word takes into account the sign as well.
llvm-svn: 301159
Diffstat (limited to 'llvm/unittests/ADT/APIntTest.cpp')
-rw-r--r-- | llvm/unittests/ADT/APIntTest.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/unittests/ADT/APIntTest.cpp b/llvm/unittests/ADT/APIntTest.cpp index 1e20ebb320c..e0a53a56455 100644 --- a/llvm/unittests/ADT/APIntTest.cpp +++ b/llvm/unittests/ADT/APIntTest.cpp @@ -288,7 +288,7 @@ TEST(APIntTest, i1) { EXPECT_EQ(zero, one.shl(1)); EXPECT_EQ(one, one.shl(0)); EXPECT_EQ(zero, one.lshr(1)); - EXPECT_EQ(zero, one.ashr(1)); + EXPECT_EQ(one, one.ashr(1)); // Rotates. EXPECT_EQ(one, one.rotl(0)); |