mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-28 08:16:05 +00:00
Add a unittest for rotating a really big APInt.
Clang miscompiles it under certain circumstances, and it's a good exercise for APInt. llvm-svn: 149986
This commit is contained in:
parent
dde136cf30
commit
6d9863be3a
@ -480,6 +480,10 @@ TEST(APIntTest, Rotate) {
|
|||||||
EXPECT_EQ(APInt(8, 64), APInt(8, 1).rotr(2));
|
EXPECT_EQ(APInt(8, 64), APInt(8, 1).rotr(2));
|
||||||
EXPECT_EQ(APInt(8, 16), APInt(8, 1).rotr(4));
|
EXPECT_EQ(APInt(8, 16), APInt(8, 1).rotr(4));
|
||||||
EXPECT_EQ(APInt(8, 1), APInt(8, 1).rotr(8));
|
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));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user