Index: test/unittests/compiler/change-lowering-unittest.cc |
diff --git a/test/unittests/compiler/change-lowering-unittest.cc b/test/unittests/compiler/change-lowering-unittest.cc |
index 7f5ec8f94b8e3394f48d77e283b96f7f7cef297f..c6b069536448b152fdd20f0d8e3688c650465110 100644 |
--- a/test/unittests/compiler/change-lowering-unittest.cc |
+++ b/test/unittests/compiler/change-lowering-unittest.cc |
@@ -188,6 +188,7 @@ class ChangeLowering32Test : public ChangeLoweringTest { |
TARGET_TEST_F(ChangeLowering32Test, ChangeInt32ToTagged) { |
Node* val = Parameter(0); |
Node* node = graph()->NewNode(simplified()->ChangeInt32ToTagged(), val); |
+ NodeProperties::SetBounds(val, Bounds(Type::None(), Type::Signed32())); |
Reduction reduction = Reduce(node); |
ASSERT_TRUE(reduction.Changed()); |
@@ -212,6 +213,19 @@ TARGET_TEST_F(ChangeLowering32Test, ChangeInt32ToTagged) { |
} |
+TARGET_TEST_F(ChangeLowering32Test, ChangeInt32ToTaggedSmall) { |
+ Node* val = Parameter(0); |
+ Node* node = graph()->NewNode(simplified()->ChangeInt32ToTagged(), val); |
+ NodeProperties::SetBounds(val, Bounds(Type::None(), Type::SignedSmall())); |
+ Reduction reduction = Reduce(node); |
+ ASSERT_TRUE(reduction.Changed()); |
+ |
+ Node* change = reduction.replacement(); |
+ Capture<Node*> add, branch, heap_number, if_true; |
+ EXPECT_THAT(change, IsWord32Shl(val, IsInt32Constant(SmiShiftAmount()))); |
+} |
+ |
+ |
TARGET_TEST_F(ChangeLowering32Test, ChangeTaggedToFloat64) { |
STATIC_ASSERT(kSmiTag == 0); |
STATIC_ASSERT(kSmiTagSize == 1); |