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

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

Issue 1776613002: [wasm] Int64Lowering of I64XConvertI32. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 4 years, 9 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 | « test/cctest/wasm/test-run-wasm-64.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 63c9a289f72bae487740f61cf2f93509262f8ba7..db4851386bd3a792dafe32cf9b31974c85cd6589 100644
--- a/test/unittests/compiler/int64-lowering-unittest.cc
+++ b/test/unittests/compiler/int64-lowering-unittest.cc
@@ -396,8 +396,53 @@ TEST_F(Int64LoweringTest, I32ConvertI64) {
IsReturn(IsInt32Constant(low_word_value(0)), start(), start()));
}
// kExprI64SConvertI32:
+TEST_F(Int64LoweringTest, I64SConvertI32) {
+ LowerGraph(graph()->NewNode(machine()->ChangeInt32ToInt64(),
+ Int32Constant(low_word_value(0))),
+ MachineRepresentation::kWord64);
+
+ EXPECT_THAT(graph()->end()->InputAt(1),
+ IsReturn2(IsInt32Constant(low_word_value(0)),
+ IsWord32Sar(IsInt32Constant(low_word_value(0)),
+ IsInt32Constant(31)),
+ start(), start()));
+}
+
+TEST_F(Int64LoweringTest, I64SConvertI32_2) {
+ LowerGraph(
+ graph()->NewNode(machine()->ChangeInt32ToInt64(),
+ graph()->NewNode(machine()->TruncateInt64ToInt32(),
+ Int64Constant(value(0)))),
+ MachineRepresentation::kWord64);
+
+ EXPECT_THAT(graph()->end()->InputAt(1),
+ IsReturn2(IsInt32Constant(low_word_value(0)),
+ IsWord32Sar(IsInt32Constant(low_word_value(0)),
+ IsInt32Constant(31)),
+ start(), start()));
+}
// kExprI64UConvertI32:
+TEST_F(Int64LoweringTest, I64UConvertI32) {
+ LowerGraph(graph()->NewNode(machine()->ChangeUint32ToUint64(),
+ Int32Constant(low_word_value(0))),
+ MachineRepresentation::kWord64);
+
+ EXPECT_THAT(graph()->end()->InputAt(1),
+ IsReturn2(IsInt32Constant(low_word_value(0)), IsInt32Constant(0),
+ start(), start()));
+}
+
+TEST_F(Int64LoweringTest, I64UConvertI32_2) {
+ LowerGraph(
+ graph()->NewNode(machine()->ChangeUint32ToUint64(),
+ graph()->NewNode(machine()->TruncateInt64ToInt32(),
+ Int64Constant(value(0)))),
+ MachineRepresentation::kWord64);
+ EXPECT_THAT(graph()->end()->InputAt(1),
+ IsReturn2(IsInt32Constant(low_word_value(0)), IsInt32Constant(0),
+ start(), start()));
+}
// kExprF64ReinterpretI64:
// kExprI64ReinterpretF64:
« no previous file with comments | « test/cctest/wasm/test-run-wasm-64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698