Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(159)

Unified Diff: test/unittests/base/bits-unittest.cc

Issue 1178403004: [turbofan] Use appropriate type for NodeId. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix useless static_cast. Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: test/unittests/base/bits-unittest.cc
diff --git a/test/unittests/base/bits-unittest.cc b/test/unittests/base/bits-unittest.cc
index 9caba8484eee0de05833a2aff1d4edcadc777435..3d17a050dbdef9dcb1618a564ad335c8227c0a24 100644
--- a/test/unittests/base/bits-unittest.cc
+++ b/test/unittests/base/bits-unittest.cc
@@ -255,6 +255,25 @@ TEST(Bits, SignedMod32) {
}
+TEST(Bits, UnsignedAddOverflow32) {
+ uint32_t val = 0;
+ EXPECT_FALSE(UnsignedAddOverflow32(0, 0, &val));
+ EXPECT_EQ(0u, val);
+ EXPECT_TRUE(
+ UnsignedAddOverflow32(std::numeric_limits<uint32_t>::max(), 1u, &val));
+ EXPECT_EQ(std::numeric_limits<uint32_t>::min(), val);
+ EXPECT_TRUE(UnsignedAddOverflow32(std::numeric_limits<uint32_t>::max(),
+ std::numeric_limits<uint32_t>::max(),
+ &val));
+ TRACED_FORRANGE(uint32_t, i, 1, 50) {
+ TRACED_FORRANGE(uint32_t, j, 1, i) {
+ EXPECT_FALSE(UnsignedAddOverflow32(i, j, &val));
+ EXPECT_EQ(i + j, val);
+ }
+ }
+}
+
+
TEST(Bits, UnsignedDiv32) {
TRACED_FORRANGE(uint32_t, i, 0, 50) {
EXPECT_EQ(0u, UnsignedDiv32(i, 0));
« no previous file with comments | « test/cctest/compiler/test-js-constant-cache.cc ('k') | test/unittests/compiler/control-equivalence-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698