[APInt] Add unittests that demonstrate how very broken APIntOps::isShiftedMask is.
authorCraig Topper <craig.topper@gmail.com>
Fri, 31 Mar 2017 06:30:25 +0000 (06:30 +0000)
committerCraig Topper <craig.topper@gmail.com>
Fri, 31 Mar 2017 06:30:25 +0000 (06:30 +0000)
commita4f660b669d7f0bb929a5fffc69a3973a29694c0
treebe9aa65f6b39ab87375aadcdb553285a523ca2dc
parent79235bd4d8c9745b823e8ab4383acc5b81d230bf
[APInt] Add unittests that demonstrate how very broken APIntOps::isShiftedMask is.

Did you know that 0 is a shifted mask? But 0x0000ff00 and 0x000000ff aren't? At least we get 0xff000000 right.

I only see one usage of this function in the code base today and its in InstCombine. I think its protected against 0 being misreported as a mask. I guess we just don't have tests for the missed cases.

llvm-svn: 299187
llvm/unittests/ADT/APIntTest.cpp