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

Unified Diff: test/unittests/compiler/mips64/instruction-selector-mips64-unittest.cc

Issue 2391393003: MIPS64: Fix Word32Compare turbofan operator implementation when comparing signed with unsigned oper… (Closed)
Patch Set: Add runtime checks to make sure optimized compare always works Created 4 years, 2 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/mips64/instruction-selector-mips64.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/mips64/instruction-selector-mips64-unittest.cc
diff --git a/test/unittests/compiler/mips64/instruction-selector-mips64-unittest.cc b/test/unittests/compiler/mips64/instruction-selector-mips64-unittest.cc
index be771266889ecc0390155591ffc7f1e75ee3a087..bd9f7d3b748fa925b1923cb5404002154df2c631 100644
--- a/test/unittests/compiler/mips64/instruction-selector-mips64-unittest.cc
+++ b/test/unittests/compiler/mips64/instruction-selector-mips64-unittest.cc
@@ -320,10 +320,40 @@ TEST_P(InstructionSelectorCmpTest, Parameter) {
StreamBuilder m(this, type, type, type);
m.Return((m.*cmp.mi.constructor)(m.Parameter(0), m.Parameter(1)));
Stream s = m.Build();
- ASSERT_EQ(cmp.expected_size, s.size());
- EXPECT_EQ(cmp.mi.arch_opcode, s[0]->arch_opcode());
- EXPECT_EQ(2U, s[0]->InputCount());
- EXPECT_EQ(1U, s[0]->OutputCount());
+
+ if (FLAG_debug_code &&
+ type.representation() == MachineRepresentation::kWord32) {
+ ASSERT_EQ(6, s.size());
+
+ EXPECT_EQ(cmp.mi.arch_opcode, s[0]->arch_opcode());
+ EXPECT_EQ(2U, s[0]->InputCount());
+ EXPECT_EQ(1U, s[0]->OutputCount());
+
+ EXPECT_EQ(kMips64Dshl, s[1]->arch_opcode());
+ EXPECT_EQ(2U, s[1]->InputCount());
+ EXPECT_EQ(1U, s[1]->OutputCount());
+
+ EXPECT_EQ(kMips64Dshl, s[2]->arch_opcode());
+ EXPECT_EQ(2U, s[2]->InputCount());
+ EXPECT_EQ(1U, s[2]->OutputCount());
+
+ EXPECT_EQ(cmp.mi.arch_opcode, s[3]->arch_opcode());
+ EXPECT_EQ(2U, s[3]->InputCount());
+ EXPECT_EQ(1U, s[3]->OutputCount());
+
+ EXPECT_EQ(kMips64AssertEqual, s[4]->arch_opcode());
+ EXPECT_EQ(3U, s[4]->InputCount());
+ EXPECT_EQ(0U, s[4]->OutputCount());
+
+ EXPECT_EQ(cmp.mi.arch_opcode, s[5]->arch_opcode());
+ EXPECT_EQ(2U, s[5]->InputCount());
+ EXPECT_EQ(1U, s[5]->OutputCount());
+ } else {
+ ASSERT_EQ(cmp.expected_size, s.size());
+ EXPECT_EQ(cmp.mi.arch_opcode, s[0]->arch_opcode());
+ EXPECT_EQ(2U, s[0]->InputCount());
+ EXPECT_EQ(1U, s[0]->OutputCount());
+ }
}
INSTANTIATE_TEST_CASE_P(InstructionSelectorTest, InstructionSelectorCmpTest,
« no previous file with comments | « src/compiler/mips64/instruction-selector-mips64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698