[PATCH] D22443: Add tests for max/minIntN(64).

Justin Lebar via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 17 11:27:02 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL275723: Add tests for max/minIntN(64). (authored by jlebar).

Changed prior to commit:
  https://reviews.llvm.org/D22443?vs=64235&id=64262#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D22443

Files:
  llvm/trunk/unittests/Support/MathExtrasTest.cpp

Index: llvm/trunk/unittests/Support/MathExtrasTest.cpp
===================================================================
--- llvm/trunk/unittests/Support/MathExtrasTest.cpp
+++ llvm/trunk/unittests/Support/MathExtrasTest.cpp
@@ -121,11 +121,15 @@
 TEST(MathExtras, maxIntN) {
   EXPECT_EQ(32767, maxIntN(16));
   EXPECT_EQ(2147483647, maxIntN(32));
+  EXPECT_EQ(std::numeric_limits<int32_t>::max(), maxIntN(32));
+  EXPECT_EQ(std::numeric_limits<int64_t>::max(), maxIntN(64));
 }
 
 TEST(MathExtras, minIntN) {
   EXPECT_EQ(-32768LL, minIntN(16));
   EXPECT_EQ(-64LL, minIntN(7));
+  EXPECT_EQ(std::numeric_limits<int32_t>::min(), minIntN(32));
+  EXPECT_EQ(std::numeric_limits<int64_t>::min(), minIntN(64));
 }
 
 TEST(MathExtras, maxUIntN) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22443.64262.patch
Type: text/x-patch
Size: 746 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160717/36079261/attachment.bin>


More information about the llvm-commits mailing list