Skip to content

Commit

Permalink
Add a unittest for rotating a really big APInt.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
d0k committed Feb 7, 2012
1 parent b0b527b commit 0ae29a6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions unittests/ADT/APIntTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

}

0 comments on commit 0ae29a6

Please sign in to comment.