Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions test/unit/interface/OpMapTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@ TEST(OpMapBasicTestsName, CoreOpContainsTests) {
OpMap<StringRef> map;

OpDescription retDesc = OpDescription::fromCoreOp(Instruction::Ret);
OpDescription brDesc = OpDescription::fromCoreOp(Instruction::Br);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is safe to change this test, the main purpose of this test is not to test Br instruction. Ret and Br are (were) two first Core LLVM instructions.

OpDescription callBrDesc = OpDescription::fromCoreOp(Instruction::CallBr);
map[retDesc] = "RetInst";

EXPECT_TRUE(map.containsCoreOp(Instruction::Ret));
EXPECT_FALSE(map.containsCoreOp(Instruction::Br));
EXPECT_FALSE(map.containsCoreOp(Instruction::CallBr));
EXPECT_EQ(map[retDesc], "RetInst");

map[brDesc] = "BrInst";
map[callBrDesc] = "CallBrInst";
EXPECT_EQ(map[retDesc], "RetInst");
EXPECT_TRUE(map.containsCoreOp(Instruction::Br));
EXPECT_EQ(map[brDesc], "BrInst");
EXPECT_TRUE(map.containsCoreOp(Instruction::CallBr));
EXPECT_EQ(map[callBrDesc], "CallBrInst");
}

TEST(OpMapBasicTestsName, IntrinsicOpContainsTests) {
Expand Down
4 changes: 2 additions & 2 deletions test/unit/interface/OpSetTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ TEST(DialectsOpSetSizeTestsName, NonEmptyOpDescriptionsTemplatizedMakerTest) {
}

TEST(DialectsOpSetContainsTestsName, containsCoreOps) {
const OpSet set = OpSet::fromCoreOpcodes({1, 2}); // Ret, Br
const OpSet set = OpSet::fromCoreOpcodes({Instruction::Ret, Instruction::CallBr});
EXPECT_TRUE(set.containsCoreOp(Instruction::Ret));
EXPECT_TRUE(set.containsCoreOp(Instruction::Br));
EXPECT_TRUE(set.containsCoreOp(Instruction::CallBr));
EXPECT_FALSE(set.containsCoreOp(Instruction::Switch));
}

Expand Down
Loading