1 ; RUN: %if spirv-tools %{ spirv-as %s -o - | spirv-val - %}
2 ; RUN: spirv-sim --function=a --wave=1 --expects=2 -i %s
3 ; RUN: spirv-sim --function=b --wave=1 --expects=1 -i %s
5 OpMemoryModel Logical GLSL450
6 OpEntryPoint GLCompute %main "main"
7 OpExecutionMode %main LocalSize 1 1 1
13 %s1 = OpTypeStruct %int %int %int
14 %s2 = OpTypeStruct %s1
15 %int_1 = OpConstant %int 1
16 %int_2 = OpConstant %int 2
17 %s1_1_2 = OpConstantComposite %s1 %int_1 %int_2 %int_1
18 %s2_s1 = OpConstantComposite %s2 %s1_1_2
20 %main_type = OpTypeFunction %void
21 %simple_type = OpTypeFunction %int
22 %main = OpFunction %void None %main_type
26 %a = OpFunction %int None %simple_type
28 %2 = OpCompositeExtract %int %s1_1_2 1
31 %b = OpFunction %int None %simple_type
33 %4 = OpCompositeExtract %int %s2_s1 0 2