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

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

Issue 840953003: [turbofan] Correctify representation changes to bit. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: std::isnan Created 5 years, 11 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 e5f46c0d538fd3dd77d5564db0039d6a5d85aec1..1a5b76a994d07a0ce6cb0133d2011df2fe2ca90b 100644
--- a/test/unittests/compiler/simplified-operator-reducer-unittest.cc
+++ b/test/unittests/compiler/simplified-operator-reducer-unittest.cc
@@ -298,6 +298,27 @@ TEST_F(SimplifiedOperatorReducerTest, ChangeBoolToBitWithChangeBitToBool) {
// -----------------------------------------------------------------------------
+// ChangeWord32ToBit
+
+
+TEST_F(SimplifiedOperatorReducerTest, ChangeWord32ToBitWithBitType) {
+ Handle<Object> zero = factory()->NewNumber(0);
+ Handle<Object> one = factory()->NewNumber(1);
+ Type* const kBitTypes[] = {
+ Type::Constant(zero, zone()), Type::Constant(one, zone()),
+ Type::Range(zero, zero, zone()), Type::Range(one, one, zone()),
+ Type::Range(zero, one, zone())};
+ TRACED_FOREACH(Type*, type, kBitTypes) {
+ Node* param0 = Parameter(type, 0);
+ Reduction reduction =
+ Reduce(graph()->NewNode(simplified()->ChangeWord32ToBit(), param0));
+ ASSERT_TRUE(reduction.Changed());
+ EXPECT_EQ(param0, reduction.replacement());
+ }
+}
+
+
+// -----------------------------------------------------------------------------
// ChangeFloat64ToTagged
« 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