| 170 | } |
| 171 | |
| 172 | spv_result_t ValidateGroupWaitEvents(ValidationState_t& _, |
| 173 | const Instruction* inst) { |
| 174 | const uint32_t num_events_id = _.GetOperandTypeId(inst, 1); |
| 175 | if (!_.IsIntScalarType(num_events_id, 32)) { |
| 176 | return _.diag(SPV_ERROR_INVALID_DATA, inst) |
| 177 | << "Expected Num Events to be a 32-bit int scalar."; |
| 178 | } |
| 179 | |
| 180 | const uint32_t events_id = _.GetOperandTypeId(inst, 2); |
| 181 | const Instruction* var_pointer = _.FindDef(events_id); |
| 182 | if (var_pointer->opcode() != spv::Op::OpTypePointer) { |
| 183 | return _.diag(SPV_ERROR_INVALID_DATA, inst) |
| 184 | << "Expected Events List to be a pointer."; |
| 185 | } |
| 186 | const Instruction* event_list_type = |
| 187 | _.FindDef(var_pointer->GetOperandAs<uint32_t>(2)); |
| 188 | if (event_list_type->opcode() != spv::Op::OpTypeEvent) { |
| 189 | return _.diag(SPV_ERROR_INVALID_DATA, inst) |
| 190 | << "Expected Events List to be a pointer to OpTypeEvent."; |
| 191 | } |
| 192 | |
| 193 | return SPV_SUCCESS; |
| 194 | } |
| 195 | |
| 196 | } // namespace |
| 197 |
no test coverage detected