llvm.org GIT mirror llvm / e7a554e
[APInt] Add PR40897 test case In reality APInt::getBitsNeeded(INT_MIN, base) cases require one less bit than is returned git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362301 91177308-0d34-0410-b5e6-96231b3b80d8 Simon Pilgrim 2 months ago
1 changed file(s) with 3 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
12611261 EXPECT_EQ(5U, APInt::getBitsNeeded("-10", 10));
12621262 EXPECT_EQ(6U, APInt::getBitsNeeded("-19", 10));
12631263 EXPECT_EQ(6U, APInt::getBitsNeeded("-20", 10));
1264
1265 // TODO: INT_MIN cases need 1 less bit (PR40897)
1266 EXPECT_EQ(9U, APInt::getBitsNeeded("-128", 10));
12641267 }
12651268
12661269 TEST(APIntTest, StringBitsNeeded16) {