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

Unified Diff: test/unittests/compiler/simplified-operator-reducer-unittest.cc

Issue 1942733002: Revert of [turbofan] Remove left-over change bits from ChangeLowering. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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/compiler/simplified-operator-reducer-unittest.cc
diff --git a/test/unittests/compiler/simplified-operator-reducer-unittest.cc b/test/unittests/compiler/simplified-operator-reducer-unittest.cc
index eec39abb42b1d7ba8c6c2676266f3f8bc4975d9e..eed25f4b1c6b40657759262a0bc9ff46c5907edd 100644
--- a/test/unittests/compiler/simplified-operator-reducer-unittest.cc
+++ b/test/unittests/compiler/simplified-operator-reducer-unittest.cc
@@ -150,54 +150,60 @@
// -----------------------------------------------------------------------------
-// ChangeTaggedToBit
-
-TEST_F(SimplifiedOperatorReducerTest, ChangeBitToTaggedWithChangeTaggedToBit) {
- Node* param0 = Parameter(0);
- Reduction reduction = Reduce(graph()->NewNode(
- simplified()->ChangeBitToTagged(),
- graph()->NewNode(simplified()->ChangeTaggedToBit(), param0)));
- ASSERT_TRUE(reduction.Changed());
- EXPECT_EQ(param0, reduction.replacement());
-}
-
-TEST_F(SimplifiedOperatorReducerTest, ChangeBitToTaggedWithZeroConstant) {
+// ChangeBoolToBit
+
+
+TEST_F(SimplifiedOperatorReducerTest, ChangeBitToBoolWithChangeBoolToBit) {
+ Node* param0 = Parameter(0);
+ Reduction reduction = Reduce(graph()->NewNode(
+ simplified()->ChangeBitToBool(),
+ graph()->NewNode(simplified()->ChangeBoolToBit(), param0)));
+ ASSERT_TRUE(reduction.Changed());
+ EXPECT_EQ(param0, reduction.replacement());
+}
+
+
+TEST_F(SimplifiedOperatorReducerTest, ChangeBitToBoolWithZeroConstant) {
Reduction reduction = Reduce(
- graph()->NewNode(simplified()->ChangeBitToTagged(), Int32Constant(0)));
+ graph()->NewNode(simplified()->ChangeBitToBool(), Int32Constant(0)));
ASSERT_TRUE(reduction.Changed());
EXPECT_THAT(reduction.replacement(), IsFalseConstant());
}
-TEST_F(SimplifiedOperatorReducerTest, ChangeBitToTaggedWithOneConstant) {
+
+TEST_F(SimplifiedOperatorReducerTest, ChangeBitToBoolWithOneConstant) {
Reduction reduction = Reduce(
- graph()->NewNode(simplified()->ChangeBitToTagged(), Int32Constant(1)));
+ graph()->NewNode(simplified()->ChangeBitToBool(), Int32Constant(1)));
ASSERT_TRUE(reduction.Changed());
EXPECT_THAT(reduction.replacement(), IsTrueConstant());
}
// -----------------------------------------------------------------------------
-// ChangeTaggedToBit
-
-TEST_F(SimplifiedOperatorReducerTest, ChangeTaggedToBitWithFalseConstant) {
+// ChangeBoolToBit
+
+
+TEST_F(SimplifiedOperatorReducerTest, ChangeBoolToBitWithFalseConstant) {
Reduction reduction = Reduce(
- graph()->NewNode(simplified()->ChangeTaggedToBit(), FalseConstant()));
+ graph()->NewNode(simplified()->ChangeBoolToBit(), FalseConstant()));
ASSERT_TRUE(reduction.Changed());
EXPECT_THAT(reduction.replacement(), IsInt32Constant(0));
}
-TEST_F(SimplifiedOperatorReducerTest, ChangeTaggedToBitWithTrueConstant) {
- Reduction reduction = Reduce(
- graph()->NewNode(simplified()->ChangeTaggedToBit(), TrueConstant()));
+
+TEST_F(SimplifiedOperatorReducerTest, ChangeBoolToBitWithTrueConstant) {
+ Reduction reduction =
+ Reduce(graph()->NewNode(simplified()->ChangeBoolToBit(), TrueConstant()));
ASSERT_TRUE(reduction.Changed());
EXPECT_THAT(reduction.replacement(), IsInt32Constant(1));
}
-TEST_F(SimplifiedOperatorReducerTest, ChangeTaggedToBitWithChangeBitToTagged) {
- Node* param0 = Parameter(0);
- Reduction reduction = Reduce(graph()->NewNode(
- simplified()->ChangeTaggedToBit(),
- graph()->NewNode(simplified()->ChangeBitToTagged(), param0)));
+
+TEST_F(SimplifiedOperatorReducerTest, ChangeBoolToBitWithChangeBitToBool) {
+ Node* param0 = Parameter(0);
+ Reduction reduction = Reduce(graph()->NewNode(
+ simplified()->ChangeBoolToBit(),
+ graph()->NewNode(simplified()->ChangeBitToBool(), param0)));
ASSERT_TRUE(reduction.Changed());
EXPECT_EQ(param0, reduction.replacement());
}
« no previous file with comments | « test/unittests/compiler/change-lowering-unittest.cc ('k') | test/unittests/compiler/simplified-operator-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698