1 ; RUN: %if spirv-tools %{ spirv-as %s -o - | spirv-val - %}
2 ; RUN: spirv-sim --function=simple --wave=1 --expects=2 -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
14 %uint_2 = OpConstant %uint 2
16 %main_type = OpTypeFunction %void
17 %simple_type = OpTypeFunction %int
18 %sub_type = OpTypeFunction %uint
19 %uint_iptr = OpTypePointer Input %uint
20 %WaveIndex = OpVariable %uint_iptr Input
21 %main = OpFunction %void None %main_type
25 %sub = OpFunction %uint None %sub_type
29 %simple = OpFunction %int None %simple_type
31 %2 = OpFunctionCall %uint %sub
32 %3 = OpBitcast %int %2