1 ; RUN: %if spirv-tools %{ spirv-as %s -o - | spirv-val - %}
2 ; RUN: spirv-sim --function=simple --wave=3 --expects=5,6,6 -i %s
4 OpCapability GroupNonUniform
5 OpMemoryModel Logical GLSL450
6 OpEntryPoint GLCompute %main "main" %WaveIndex
7 OpExecutionMode %main LocalSize 1 1 1
9 OpName %simple "simple"
11 OpDecorate %WaveIndex BuiltIn SubgroupLocalInvocationId
13 %uint = OpTypeInt 32 0
15 %int_2 = OpConstant %int 2
16 %int_5 = OpConstant %int 5
17 %int_6 = OpConstant %int 6
18 %uint_0 = OpConstant %uint 0
20 %main_type = OpTypeFunction %void
21 %simple_type = OpTypeFunction %int
22 %uint_iptr = OpTypePointer Input %uint
23 %WaveIndex = OpVariable %uint_iptr Input
24 %main = OpFunction %void None %main_type
28 %simple = OpFunction %int None %simple_type
30 %2 = OpLoad %uint %WaveIndex
31 %3 = OpIEqual %bool %uint_0 %2
32 OpSelectionMerge %merge None
33 OpBranchConditional %3 %true %false
39 %4 = OpPhi %int %int_5 %true %int_6 %false