From: Justin Lebar Date: Sun, 17 Jul 2016 18:19:28 +0000 (+0000) Subject: Add tests for max/minIntN(64). X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5e704c77a9df9d1d7824c0d4c778097d59ab53b7;p=llvm Add tests for max/minIntN(64). Summary: Given that we had a bug on max/minUIntN(64), these should have tests too. Reviewers: rnk Subscribers: dylanmckay, llvm-commits Differential Revision: https://reviews.llvm.org/D22443 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275723 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/unittests/Support/MathExtrasTest.cpp b/unittests/Support/MathExtrasTest.cpp index 3d449ccb209..d373030881e 100644 --- a/unittests/Support/MathExtrasTest.cpp +++ b/unittests/Support/MathExtrasTest.cpp @@ -121,11 +121,15 @@ TEST(MathExtras, isUIntN) { TEST(MathExtras, maxIntN) { EXPECT_EQ(32767, maxIntN(16)); EXPECT_EQ(2147483647, maxIntN(32)); + EXPECT_EQ(std::numeric_limits::max(), maxIntN(32)); + EXPECT_EQ(std::numeric_limits::max(), maxIntN(64)); } TEST(MathExtras, minIntN) { EXPECT_EQ(-32768LL, minIntN(16)); EXPECT_EQ(-64LL, minIntN(7)); + EXPECT_EQ(std::numeric_limits::min(), minIntN(32)); + EXPECT_EQ(std::numeric_limits::min(), minIntN(64)); } TEST(MathExtras, maxUIntN) {