| 91 | } |
| 92 | |
| 93 | spv_result_t ValidateExpect(ValidationState_t& _, const Instruction* inst) { |
| 94 | const auto result_type = inst->type_id(); |
| 95 | if (!_.IsBoolScalarOrVectorType(result_type) && |
| 96 | !_.IsIntScalarOrVectorType(result_type)) { |
| 97 | return _.diag(SPV_ERROR_INVALID_ID, inst) |
| 98 | << "Result of OpExpectKHR must be a scalar or vector of integer " |
| 99 | "type or boolean type"; |
| 100 | } |
| 101 | |
| 102 | if (_.GetOperandTypeId(inst, 2) != result_type) { |
| 103 | return _.diag(SPV_ERROR_INVALID_ID, inst) |
| 104 | << "Type of Value operand of OpExpectKHR does not match the result " |
| 105 | "type "; |
| 106 | } |
| 107 | if (_.GetOperandTypeId(inst, 3) != result_type) { |
| 108 | return _.diag(SPV_ERROR_INVALID_ID, inst) |
| 109 | << "Type of ExpectedValue operand of OpExpectKHR does not match the " |
| 110 | "result type "; |
| 111 | } |
| 112 | return SPV_SUCCESS; |
| 113 | } |
| 114 | |
| 115 | spv_result_t ValidateAbort(ValidationState_t& _, const Instruction* inst) { |
| 116 | const auto message_type = _.FindDef(inst->GetOperandAs<uint32_t>(0u)); |
no test coverage detected