mirror of
https://gitee.com/openharmony/third_party_spirv-tools
synced 2024-11-23 23:39:40 +00:00
Test ir::Instruction::GetOperand and GetInOperand
This commit is contained in:
parent
cc60caba1d
commit
58e1a1e3be
@ -91,6 +91,19 @@ TEST(InstructionTest, CreateWithOpcodeAndOperands) {
|
||||
EXPECT_EQ(2u, inst.NumInOperandWords());
|
||||
}
|
||||
|
||||
TEST(InstructionTest, GetOperand) {
|
||||
Instruction inst(kSampleParsedInstruction);
|
||||
EXPECT_THAT(inst.GetOperand(0).words, Eq(std::vector<uint32_t>{44}));
|
||||
EXPECT_THAT(inst.GetOperand(1).words, Eq(std::vector<uint32_t>{32}));
|
||||
EXPECT_THAT(inst.GetOperand(2).words, Eq(std::vector<uint32_t>{1}));
|
||||
}
|
||||
|
||||
TEST(InstructionTest, GetInOperand) {
|
||||
Instruction inst(kSampleParsedInstruction);
|
||||
EXPECT_THAT(inst.GetInOperand(0).words, Eq(std::vector<uint32_t>{32}));
|
||||
EXPECT_THAT(inst.GetInOperand(1).words, Eq(std::vector<uint32_t>{1}));
|
||||
}
|
||||
|
||||
TEST(InstructionTest, OperandConstIterators) {
|
||||
Instruction inst(kSampleParsedInstruction);
|
||||
// Spot check iteration across operands.
|
||||
|
Loading…
Reference in New Issue
Block a user