MCPcopy Create free account
hub / github.com/KhronosGroup/SPIRV-Tools / TEST

Function TEST

test/diff/diff_files/reordered_switch_blocks_autogen.cpp:211–311  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

209)";
210
211TEST(DiffTest, ReorderedSwitchBlocks) {
212 constexpr char kDiff[] = R"( ; SPIR-V
213 ; Version: 1.6
214 ; Generator: Khronos SPIR-V Tools Assembler; 0
215 ; Bound: 58
216 ; Schema: 0
217 OpCapability Shader
218 %1 = OpExtInstImport "GLSL.std.450"
219 OpMemoryModel Logical GLSL450
220 OpEntryPoint GLCompute %4 "main"
221 OpExecutionMode %4 LocalSize 1 1 1
222 OpSource ESSL 310
223 OpName %4 "main"
224 OpName %7 "BufferIn"
225 OpMemberName %7 0 "i"
226 OpName %9 ""
227 OpName %23 "BufferOut"
228 OpMemberName %23 0 "o"
229 OpName %25 ""
230 OpMemberDecorate %7 0 Offset 0
231 OpDecorate %7 Block
232 OpDecorate %9 DescriptorSet 0
233 OpDecorate %9 Binding 0
234 OpMemberDecorate %23 0 Offset 0
235 OpDecorate %23 BufferBlock
236 OpDecorate %25 DescriptorSet 0
237 OpDecorate %25 Binding 1
238 %2 = OpTypeVoid
239 %3 = OpTypeFunction %2
240 %6 = OpTypeInt 32 0
241 %7 = OpTypeStruct %6
242 %8 = OpTypePointer Uniform %7
243 %9 = OpVariable %8 Uniform
244 %10 = OpTypeInt 32 1
245 %11 = OpConstant %10 0
246 %12 = OpTypePointer Uniform %6
247 %23 = OpTypeStruct %6
248 %24 = OpTypePointer Uniform %23
249 %25 = OpVariable %24 Uniform
250 %28 = OpConstant %10 1
251 %34 = OpConstant %6 2
252 %52 = OpConstant %6 1
253 %4 = OpFunction %2 None %3
254 %5 = OpLabel
255 %13 = OpAccessChain %12 %9 %11
256 %14 = OpLoad %6 %13
257 OpSelectionMerge %22 None
258 OpSwitch %14 %21 0 %15 1 %16 2 %17 3 %18 4 %19 5 %20
259 %20 = OpLabel
260 %53 = OpAccessChain %12 %25 %11
261 OpStore %53 %52
262 OpBranch %21
263 %19 = OpLabel
264 %45 = OpAccessChain %12 %25 %11
265 %46 = OpLoad %6 %45
266 %47 = OpAccessChain %12 %25 %11
267 %48 = OpLoad %6 %47
268 %49 = OpIMul %6 %46 %48

Callers

nothing calls this directly

Calls 1

DoStringDiffTestFunction · 0.85

Tested by

no test coverage detected