summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-06-23 18:08:58 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-06-23 18:08:58 +0000
commit820c3ab3d9f987ccf27c6ebbdc4fdc436fc3a83e (patch)
tree41d586b258f2d4db62b647fd2233e497611014f1
parent6f81e75dab4288cdb4928620ffab33ae0afa1dfa (diff)
downloadbcm5719-llvm-820c3ab3d9f987ccf27c6ebbdc4fdc436fc3a83e.tar.gz
bcm5719-llvm-820c3ab3d9f987ccf27c6ebbdc4fdc436fc3a83e.zip
Cleanup r211507
llvm-svn: 211521
-rw-r--r--llvm/include/llvm/Support/ScaledNumber.h2
-rw-r--r--llvm/unittests/Support/ScaledNumberTest.cpp2
2 files changed, 3 insertions, 1 deletions
diff --git a/llvm/include/llvm/Support/ScaledNumber.h b/llvm/include/llvm/Support/ScaledNumber.h
index 6a93623a8e9..240d5b64aa8 100644
--- a/llvm/include/llvm/Support/ScaledNumber.h
+++ b/llvm/include/llvm/Support/ScaledNumber.h
@@ -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;
diff --git a/llvm/unittests/Support/ScaledNumberTest.cpp b/llvm/unittests/Support/ScaledNumberTest.cpp
index f6d7a44754f..4a274d7e50e 100644
--- a/llvm/unittests/Support/ScaledNumberTest.cpp
+++ b/llvm/unittests/Support/ScaledNumberTest.cpp
@@ -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));
OpenPOWER on IntegriCloud