[llvm-commits] [llvm] r149986 - /llvm/trunk/unittests/ADT/APIntTest.cpp

Benjamin Kramer benny.kra at googlemail.com
Tue Feb 7 08:27:39 PST 2012


Author: d0k
Date: Tue Feb  7 10:27:39 2012
New Revision: 149986

URL: http://llvm.org/viewvc/llvm-project?rev=149986&view=rev
Log:
Add a unittest for rotating a really big APInt.

Clang miscompiles it under certain circumstances, and it's a good exercise for APInt.

Modified:
    llvm/trunk/unittests/ADT/APIntTest.cpp

Modified: llvm/trunk/unittests/ADT/APIntTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ADT/APIntTest.cpp?rev=149986&r1=149985&r2=149986&view=diff
==============================================================================
--- llvm/trunk/unittests/ADT/APIntTest.cpp (original)
+++ llvm/trunk/unittests/ADT/APIntTest.cpp Tue Feb  7 10:27:39 2012
@@ -480,6 +480,10 @@
   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));
 }
 
 }





More information about the llvm-commits mailing list