aboutsummaryrefslogtreecommitdiff
path: root/unittests/ADT
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2012-02-07 16:27:39 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2012-02-07 16:27:39 +0000
commit0ae29a6b37204d95761a859d647f3e13a415c2d2 (patch)
tree059214b5b952824d0ab9028f35ab75238c60e5aa /unittests/ADT
parentb0b527b62cdcbe6e1a5947534fd749b310856a17 (diff)
Add a unittest for rotating a really big APInt.
Clang miscompiles it under certain circumstances, and it's a good exercise for APInt. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149986 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/ADT')
-rw-r--r--unittests/ADT/APIntTest.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/unittests/ADT/APIntTest.cpp b/unittests/ADT/APIntTest.cpp
index d5d2bc175f..89b8aa94e4 100644
--- a/unittests/ADT/APIntTest.cpp
+++ b/unittests/ADT/APIntTest.cpp
@@ -480,6 +480,10 @@ TEST(APIntTest, Rotate) {
EXPECT_EQ(APInt(8, 64), APInt(8, 1).rotr(2));
EXPECT_EQ(APInt(8, 16), APInt(8, 1).rotr(4));
EXPECT_EQ(APInt(8, 1), APInt(8, 1).rotr(8));
+
+ APInt Big(256, "00004000800000000000000000003fff8000000000000000", 16);
+ APInt Rot(256, "3fff80000000000000000000000000000000000040008000", 16);
+ EXPECT_EQ(Rot, Big.rotr(144));
}
}