Merge V8 5.2.361.47 DO NOT MERGE
https://chromium.googlesource.com/v8/v8/+/5.2.361.47
FPIIM-449
Change-Id: Ibec421b85a9b88cb3a432ada642e469fe7e78346
(cherry picked from commit bcf72ee8e3b26f1d0726869c7ddb3921c68b09a8)
diff --git a/test/cctest/compiler/test-branch-combine.cc b/test/cctest/compiler/test-branch-combine.cc
index c3b4308..c5c4166 100644
--- a/test/cctest/compiler/test-branch-combine.cc
+++ b/test/cctest/compiler/test-branch-combine.cc
@@ -457,6 +457,27 @@
}
}
+TEST(BranchCombineEffectLevel) {
+ // Test that the load doesn't get folded into the branch, as there's a store
+ // between them. See http://crbug.com/611976.
+ int32_t input = 0;
+
+ RawMachineAssemblerTester<int32_t> m;
+ Node* a = m.LoadFromPointer(&input, MachineType::Int32());
+ Node* compare = m.Word32And(a, m.Int32Constant(1));
+ Node* equal = m.Word32Equal(compare, m.Int32Constant(0));
+ m.StoreToPointer(&input, MachineRepresentation::kWord32, m.Int32Constant(1));
+
+ RawMachineLabel blocka, blockb;
+ m.Branch(equal, &blocka, &blockb);
+ m.Bind(&blocka);
+ m.Return(m.Int32Constant(42));
+ m.Bind(&blockb);
+ m.Return(m.Int32Constant(0));
+
+ CHECK_EQ(42, m.Call());
+}
+
} // namespace compiler
} // namespace internal
} // namespace v8