Skip to content

Commit

Permalink
Add test coverage for alloca operations
Browse files Browse the repository at this point in the history
  • Loading branch information
hassansalehe committed Jun 26, 2021
1 parent fa1a90f commit 4016f8d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/Common_Instruction_gtest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,11 @@ TEST(InstructionTests, CheckInstructionForLoad) {
EXPECT_EQ("i32", instr.type);
EXPECT_EQ("%balance", instr.operand1);
}

TEST(InstructionTests, CheckInstructionForAlloca) {
std::string raw_instruction("%balance = alloca i32 , align 4 ");
Instruction instr(raw_instruction);
EXPECT_EQ(ALLOCA, instr.oper);
EXPECT_EQ("%balance", instr.destination);
EXPECT_EQ("i32", instr.type);
}

0 comments on commit 4016f8d

Please sign in to comment.