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

Unified Diff: test/unittests/compiler/int64-lowering-unittest.cc

Issue 2668023004: [wasm] Change the default lowering of stores. (Closed)
Patch Set: Created 3 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
« no previous file with comments | « src/compiler/int64-lowering.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/unittests/compiler/int64-lowering-unittest.cc
diff --git a/test/unittests/compiler/int64-lowering-unittest.cc b/test/unittests/compiler/int64-lowering-unittest.cc
index 83c8d003dbeeffd8be7ccc6c0dab8f8595ebb550..b55f81908816a0154873a8cc2e37d55dd304d30a 100644
--- a/test/unittests/compiler/int64-lowering-unittest.cc
+++ b/test/unittests/compiler/int64-lowering-unittest.cc
@@ -237,6 +237,38 @@ TEST_F(Int64LoweringTest, Int64Store) {
INT64_STORE_LOWERING(Store, rep32, rep64);
}
+TEST_F(Int64LoweringTest, Int32Store) {
+ const StoreRepresentation rep32(MachineRepresentation::kWord32,
+ WriteBarrierKind::kNoWriteBarrier);
+ int32_t base = 1111;
+ int32_t index = 2222;
+ int32_t return_value = 0x5555;
+
+ Signature<MachineRepresentation>::Builder sig_builder(zone(), 1, 0);
+ sig_builder.AddReturn(MachineRepresentation::kWord32);
+
+ Node* store = graph()->NewNode(machine()->Store(rep32), Int32Constant(base),
+ Int32Constant(index), Int64Constant(value(0)),
+ start(), start());
+
+ Node* zero = graph()->NewNode(common()->Int32Constant(0));
+ Node* ret = graph()->NewNode(common()->Return(), zero,
+ Int32Constant(return_value), store, start());
+
+ NodeProperties::MergeControlToEnd(graph(), common(), ret);
+
+ Int64Lowering lowering(graph(), machine(), common(), zone(),
+ sig_builder.Build());
+ lowering.LowerGraph();
+
+ EXPECT_THAT(
+ graph()->end()->InputAt(1),
+ IsReturn(IsInt32Constant(return_value),
+ IsStore(rep32, IsInt32Constant(base), IsInt32Constant(index),
+ IsInt32Constant(low_word_value(0)), start(), start()),
+ start()));
+}
+
TEST_F(Int64LoweringTest, Int64UnalignedStore) {
const UnalignedStoreRepresentation rep64(MachineRepresentation::kWord64);
const UnalignedStoreRepresentation rep32(MachineRepresentation::kWord32);
« no previous file with comments | « src/compiler/int64-lowering.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698