Cleanup r211507

llvm-svn: 211521
This commit is contained in:
Duncan P. N. Exon Smith 2014-06-23 18:08:58 +00:00
parent 42c866343b
commit c484dba251
2 changed files with 3 additions and 1 deletions

View File

@ -242,6 +242,8 @@ int compareImpl(uint64_t L, uint64_t R, int ScaleDiff);
/// for greater than.
template <class DigitsT>
int compare(DigitsT LDigits, int16_t LScale, DigitsT RDigits, int16_t RScale) {
static_assert(!std::numeric_limits<DigitsT>::is_signed, "expected unsigned");
// Check for zero.
if (!LDigits)
return RDigits ? -1 : 0;

View File

@ -285,7 +285,7 @@ TEST(ScaledNumberHelpersTest, getLgCeiling) {
EXPECT_EQ(INT32_MIN, getLgCeiling(UINT64_C(0), 1));
}
TEST(ScaledNumberHelpersTest, Compare) {
TEST(ScaledNumberHelpersTest, compare) {
EXPECT_EQ(0, compare(UINT32_C(0), 0, UINT32_C(0), 1));
EXPECT_EQ(0, compare(UINT32_C(0), 0, UINT32_C(0), -10));
EXPECT_EQ(0, compare(UINT32_C(0), 0, UINT32_C(0), 20));