aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Support/ScaledNumberTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/unittests/Support/ScaledNumberTest.cpp')
-rw-r--r--llvm/unittests/Support/ScaledNumberTest.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/unittests/Support/ScaledNumberTest.cpp b/llvm/unittests/Support/ScaledNumberTest.cpp
index 3872155..2f38b2a 100644
--- a/llvm/unittests/Support/ScaledNumberTest.cpp
+++ b/llvm/unittests/Support/ScaledNumberTest.cpp
@@ -556,4 +556,9 @@ TEST(ScaledNumberHelpersTest, arithmeticOperators) {
EXPECT_EQ(ScaledNumber<uint64_t>(1, 4), ScaledNumber<uint64_t>(1, 3) << 1);
}
+TEST(ScaledNumberHelpersTest, toIntBug) {
+ ScaledNumber<uint32_t> n(1, 0);
+ EXPECT_EQ(1u, (n * n).toInt<uint32_t>());
+}
+
} // end namespace