From 4016f8d8cedcce475dd7e3bcc702869ef1967e7f Mon Sep 17 00:00:00 2001 From: "Hassan @Ubuntu" Date: Sat, 26 Jun 2021 23:43:53 +0200 Subject: [PATCH] Add test coverage for alloca operations --- test/Common_Instruction_gtest.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/Common_Instruction_gtest.cc b/test/Common_Instruction_gtest.cc index e0158ed..8760329 100644 --- a/test/Common_Instruction_gtest.cc +++ b/test/Common_Instruction_gtest.cc @@ -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); +}