TODO(atgoo@github.com) The following test is not valid as it generates invalid combinations of images, instructions and image operands. Creates assembly containing an OpImageFetch instruction using operands for the image-operands part. The assembly defines constants %fzero and %izero that can be used for operands where IDs are required. The assembly is valid, apart from not declaring any capabi
| 2324 | // that can be used for operands where IDs are required. The assembly is valid, |
| 2325 | // apart from not declaring any capabilities required by the operands. |
| 2326 | string ImageOperandsTemplate(const std::string& operands) { |
| 2327 | ostringstream ss; |
| 2328 | // clang-format off |
| 2329 | ss << R"( |
| 2330 | OpCapability Kernel |
| 2331 | OpCapability Linkage |
| 2332 | OpMemoryModel Logical OpenCL |
| 2333 | |
| 2334 | %i32 = OpTypeInt 32 0 |
| 2335 | %f32 = OpTypeFloat 32 |
| 2336 | %v4i32 = OpTypeVector %i32 4 |
| 2337 | %timg = OpTypeImage %i32 2D 0 0 0 0 Unknown |
| 2338 | %pimg = OpTypePointer UniformConstant %timg |
| 2339 | %tfun = OpTypeFunction %i32 |
| 2340 | |
| 2341 | %vimg = OpVariable %pimg UniformConstant |
| 2342 | %izero = OpConstant %i32 0 |
| 2343 | %fzero = OpConstant %f32 0. |
| 2344 | |
| 2345 | %main = OpFunction %i32 None %tfun |
| 2346 | %lbl = OpLabel |
| 2347 | %img = OpLoad %timg %vimg |
| 2348 | %r1 = OpImageFetch %v4i32 %img %izero )" << operands << R"( |
| 2349 | OpReturnValue %izero |
| 2350 | OpFunctionEnd |
| 2351 | )"; |
| 2352 | // clang-format on |
| 2353 | return ss.str(); |
| 2354 | } |
| 2355 | |
| 2356 | INSTANTIATE_TEST_SUITE_P( |
| 2357 | TwoImageOperandsMask, ValidateCapability, |
no test coverage detected