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

llvm-svn: 275723
This commit is contained in:
Justin Lebar 2016-07-17 18:19:28 +00:00
parent b59c1dd5cf
commit 1e50e3b3e3
1 changed files with 4 additions and 0 deletions

View File

@ -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<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) {