Index: test/unittests/base/logging-unittest.cc |
diff --git a/test/unittests/base/logging-unittest.cc b/test/unittests/base/logging-unittest.cc |
index 5c0ca007c4d0524722194d468bff9aaaec733437..e59456f4fc61bd04ade8550a7cf6bef8d16c0ae2 100644 |
--- a/test/unittests/base/logging-unittest.cc |
+++ b/test/unittests/base/logging-unittest.cc |
@@ -63,5 +63,24 @@ TEST(LoggingTest, CompareAgainstStaticConstPointer) { |
CHECK_SUCCEED(GT, 0, v8::internal::Smi::kMinValue); |
} |
+TEST(LoggingTest, CompareWithDifferentSignedness) { |
+#define CHECK_BOTH(name, lhs, rhs) \ |
+ CHECK_##name(lhs, rhs); \ |
+ DCHECK_##name(lhs, rhs) |
+ |
+ int32_t i32 = 10; |
+ uint32_t u32 = 20; |
+ int64_t i64 = 30; |
+ uint64_t u64 = 40; |
+ |
+ // All these checks should compile (!) and succeed. |
+ CHECK_BOTH(EQ, i32 + 10, u32); |
+ CHECK_BOTH(LT, i32, u64); |
+ CHECK_BOTH(LE, u32, i64); |
+ CHECK_BOTH(IMPLIES, i32, i64); |
+ CHECK_BOTH(IMPLIES, u32, i64); |
+ CHECK_BOTH(IMPLIES, !u32, !i64); |
+} |
+ |
} // namespace base |
} // namespace v8 |