This is an archive of the discontinued LLVM Phabricator instance.

MathExtras UnitTest: Assert that isPowerOf2(0) is false. NFC.
ClosedPublic

Authored by zvi on Jul 3 2017, 4:36 AM.

Details

Summary

This is a follow-up on D34077. Elena observed that the
correctness of the code relies on isPowerOf2(0) returning false.
Adding a test to cover this corner-case.

Event Timeline

zvi created this revision.Jul 3 2017, 4:36 AM
davide accepted this revision.Jul 3 2017, 10:21 AM

LGTM as this is actually documenting the current behaviour more explicity.
Feel free to commit cleanup like this without a pre-commit review (somebody will complain post commit if needed :)

This revision is now accepted and ready to land.Jul 3 2017, 10:21 AM
zvi added a comment.Jul 3 2017, 11:40 AM

Thanks :)

This revision was automatically updated to reflect the committed changes.