diff options
Diffstat (limited to 'test/opt/ir_loader_test.cpp')
-rw-r--r-- | test/opt/ir_loader_test.cpp | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/test/opt/ir_loader_test.cpp b/test/opt/ir_loader_test.cpp index ccdd032ee..45104f471 100644 --- a/test/opt/ir_loader_test.cpp +++ b/test/opt/ir_loader_test.cpp @@ -244,10 +244,10 @@ TEST(IrBuilder, DistributeLineDebugInfo) { auto& lines = def_use_mgr->GetDef(check.id)->dbg_line_insts(); for (uint32_t i = 0; i < check.line_numbers.size(); ++i) { if (check.line_numbers[i] == kNoLine) { - EXPECT_EQ(lines[i].opcode(), SpvOpNoLine); + EXPECT_EQ(lines[i].opcode(), spv::Op::OpNoLine); continue; } - EXPECT_EQ(lines[i].opcode(), SpvOpLine); + EXPECT_EQ(lines[i].opcode(), spv::Op::OpLine); EXPECT_EQ(lines[i].GetSingleWordOperand(kOpLineOperandLineIndex), check.line_numbers[i]); } @@ -286,9 +286,10 @@ OpFunctionEnd spvtools::opt::analysis::DefUseManager* def_use_mgr = context->get_def_use_mgr(); - std::vector<SpvOp> opcodes; + std::vector<spv::Op> opcodes; for (auto* inst = def_use_mgr->GetDef(1); - inst && (inst->opcode() != SpvOpFunctionEnd); inst = inst->NextNode()) { + inst && (inst->opcode() != spv::Op::OpFunctionEnd); + inst = inst->NextNode()) { inst->ForEachInst( [&opcodes](spvtools::opt::Instruction* sub_inst) { opcodes.push_back(sub_inst->opcode()); @@ -296,9 +297,9 @@ OpFunctionEnd true); } - EXPECT_THAT(opcodes, - ContainerEq(std::vector<SpvOp>{SpvOpFAdd, SpvOpLine, SpvOpFMul, - SpvOpFSub, SpvOpReturn})); + EXPECT_THAT(opcodes, ContainerEq(std::vector<spv::Op>{ + spv::Op::OpFAdd, spv::Op::OpLine, spv::Op::OpFMul, + spv::Op::OpFSub, spv::Op::OpReturn})); } TEST(IrBuilder, BuildModule_WithExtraLines_IsDefault) { @@ -333,9 +334,10 @@ OpFunctionEnd spvtools::opt::analysis::DefUseManager* def_use_mgr = context->get_def_use_mgr(); - std::vector<SpvOp> opcodes; + std::vector<spv::Op> opcodes; for (auto* inst = def_use_mgr->GetDef(1); - inst && (inst->opcode() != SpvOpFunctionEnd); inst = inst->NextNode()) { + inst && (inst->opcode() != spv::Op::OpFunctionEnd); + inst = inst->NextNode()) { inst->ForEachInst( [&opcodes](spvtools::opt::Instruction* sub_inst) { opcodes.push_back(sub_inst->opcode()); @@ -343,9 +345,10 @@ OpFunctionEnd true); } - EXPECT_THAT(opcodes, ContainerEq(std::vector<SpvOp>{ - SpvOpFAdd, SpvOpLine, SpvOpFMul, SpvOpLine, - SpvOpFSub, SpvOpLine, SpvOpReturn})); + EXPECT_THAT(opcodes, ContainerEq(std::vector<spv::Op>{ + spv::Op::OpFAdd, spv::Op::OpLine, spv::Op::OpFMul, + spv::Op::OpLine, spv::Op::OpFSub, spv::Op::OpLine, + spv::Op::OpReturn})); } TEST(IrBuilder, ConsumeDebugInfoInst) { @@ -1297,8 +1300,9 @@ TEST(IrBuilder, OpUndefOutsideFunction) { const auto opundef_count = std::count_if( context->module()->types_values_begin(), - context->module()->types_values_end(), - [](const Instruction& inst) { return inst.opcode() == SpvOpUndef; }); + context->module()->types_values_end(), [](const Instruction& inst) { + return inst.opcode() == spv::Op::OpUndef; + }); EXPECT_EQ(3, opundef_count); std::vector<uint32_t> binary; |