Skip to content

Commit

Permalink
Add test case for load instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
hassansalehe committed Jun 26, 2021
1 parent 04b83b9 commit fa1a90f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/Common_Instruction_gtest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,12 @@ TEST(InstructionTests, CheckInstructionForStore) {
EXPECT_EQ("%2", instr.operand1);
EXPECT_EQ("%2", instr.operand2);
}

TEST(InstructionTests, CheckInstructionForLoad) {
std::string raw_instruction(" %1 = load i32 * %balance");
Instruction instr(raw_instruction);
EXPECT_EQ(LOAD, instr.oper);
EXPECT_EQ("%1", instr.destination);
EXPECT_EQ("i32", instr.type);
EXPECT_EQ("%balance", instr.operand1);
}

0 comments on commit fa1a90f

Please sign in to comment.