]> granicus.if.org Git - llvm/commit
[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)
commitdbf64c9e9746d560e59baa7ca6bd4e0c66014a1e
tree98a45fb7134c86da3eea0de22e053781152cadad
parent1fcb6de3bd635eb764227af51c50cc32736b3448
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299187 91177308-0d34-0410-b5e6-96231b3b80d8
unittests/ADT/APIntTest.cpp