Index: test/unittests/compiler/js-typed-lowering-unittest.cc |
diff --git a/test/unittests/compiler/js-typed-lowering-unittest.cc b/test/unittests/compiler/js-typed-lowering-unittest.cc |
index 979d14616425fb63ceb1b935d7222421e12481aa..80e071d1ec1c696bd7434bc8da5576af8459a851 100644 |
--- a/test/unittests/compiler/js-typed-lowering-unittest.cc |
+++ b/test/unittests/compiler/js-typed-lowering-unittest.cc |
@@ -130,6 +130,17 @@ TEST_F(JSTypedLoweringTest, JSToBooleanWithReceiverOrNullOrUndefined) { |
EXPECT_THAT(r.replacement(), IsBooleanNot(IsObjectIsUndetectable(input))); |
} |
+TEST_F(JSTypedLoweringTest, JSToBooleanWithString) { |
+ Node* input = Parameter(Type::String(), 0); |
+ Node* context = Parameter(Type::Any(), 1); |
+ Reduction r = Reduce(graph()->NewNode( |
+ javascript()->ToBoolean(ToBooleanHint::kAny), input, context)); |
+ ASSERT_TRUE(r.Changed()); |
+ EXPECT_THAT(r.replacement(), |
+ IsBooleanNot(IsReferenceEqual( |
+ input, IsHeapConstant(factory()->empty_string())))); |
+} |
+ |
TEST_F(JSTypedLoweringTest, JSToBooleanWithAny) { |
Node* input = Parameter(Type::Any(), 0); |
Node* context = Parameter(Type::Any(), 1); |