mirror of
https://github.com/KhronosGroup/SPIRV-Tools
synced 2025-01-13 18:00:05 +00:00
Eliminate parameter-order check from ID-validation.
This commit is contained in:
parent
10fa696af7
commit
4038195d81
@ -964,12 +964,6 @@ bool idUsage::isValid<SpvOpFunctionParameter>(const spv_instruction_t* inst,
|
||||
size_t paramIndex = 0;
|
||||
assert(firstInst < inst && "Invalid instruction pointer");
|
||||
while (firstInst != --inst) {
|
||||
spvCheck(SpvOpFunction != inst->opcode &&
|
||||
SpvOpFunctionParameter != inst->opcode &&
|
||||
SpvOpLine != inst->opcode && SpvOpNoLine != inst->opcode,
|
||||
DIAG(0) << "OpFunctionParameter is not preceded by OpFunction or "
|
||||
"OpFunctionParameter sequence.";
|
||||
return false);
|
||||
if (SpvOpFunction == inst->opcode) {
|
||||
break;
|
||||
} else if (SpvOpFunctionParameter == inst->opcode) {
|
||||
|
@ -1064,20 +1064,6 @@ TEST_F(ValidateID, OpFunctionParameterResultTypeBad) {
|
||||
OpFunctionEnd)";
|
||||
CHECK(spirv, SPV_ERROR_INVALID_ID);
|
||||
}
|
||||
TEST_F(ValidateID, OpFunctionParameterOrderBad) {
|
||||
const char* spirv = R"(
|
||||
%1 = OpTypeVoid
|
||||
%2 = OpTypeInt 32 0
|
||||
%3 = OpTypeFunction %1 %2
|
||||
%7 = OpTypePointer Function %2
|
||||
%4 = OpFunction %1 None %3
|
||||
%8 = OpVariable %7 Function
|
||||
%5 = OpFunctionParameter %2
|
||||
%6 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd)";
|
||||
CHECK(spirv, SPV_ERROR_INVALID_ID);
|
||||
}
|
||||
|
||||
TEST_F(ValidateID, OpFunctionCallGood) {
|
||||
const char* spirv = R"(
|
||||
|
Loading…
Reference in New Issue
Block a user