119734787 65536 458752 36 0
2 Capability Addresses
2 Capability Linkage
2 Capability Kernel
2 Capability Int64
3 MemoryModel 2 2
9 EntryPoint 6 1 "select_if_dont_flatten"
3 Source 3 102000
3 Name 2 "res"
3 Name 3 "lhs"
3 Name 4 "rhs"
4 Decorate 5 FuncParamAttr 5
2 DecorationGroup 5
4 Decorate 6 BuiltIn 28
3 Decorate 6 Constant
11 Decorate 6 LinkageAttributes "__spirv_GlobalInvocationId" Import
5 GroupDecorate 5 2 3 4
4 TypeInt 7 64 0
4 TypeInt 12 32 0
5 Constant 7 13 32 0
4 Constant 12 14 0
4 TypeVector 8 7 3
4 TypePointer 9 0 8
2 TypeBool 10
2 TypeVoid 11
4 TypePointer 15 5 12
4 TypePointer 16 7 12
6 TypeFunction 17 11 15 15 15
4 Variable 9 6 0

5 Function 11 1 0 17
3 FunctionParameter 15 2
3 FunctionParameter 15 3
3 FunctionParameter 15 4

2 Label 18
4 Variable 16 27 7
4 Load 8 19 6
5 CompositeExtract 7 20 19 0
5 ShiftLeftLogical 7 21 20 13
5 ShiftRightArithmetic 7 22 21 13
5 InBoundsPtrAccessChain 15 23 3 22
6 Load 12 24 23 2 4
5 InBoundsPtrAccessChain 15 25 4 22
6 Load 12 26 25 2 4
3 Store 27 14
5 SLessThan 10 28 24 26
3 SelectionMerge 29 2
4 BranchConditional 28 30 31

2 Label 30
5 ISub 12 32 26 24
3 Store 27 32
2 Branch 29

2 Label 31
5 ISub 12 33 24 26
3 Store 27 33
2 Branch 29

2 Label 29
4 Load 12 34 27
5 InBoundsPtrAccessChain 15 35 2 22
5 Store 35 34 2 4
1 Return

1 FunctionEnd
; RUN: llvm-spirv %s -to-binary -o %t.spv
; RUN: spirv-val %t.spv
; RUN: llvm-spirv %t.spv -to-text -o %t.spt
; RUN: FileCheck < %t.spt %s --check-prefix=CHECK-SPIRV
; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o %t.bc

; CHECK-SPIRV: 3 SelectionMerge {{[0-9]*}} 2
; CHECK-SPIRV-NEXT: 4 BranchConditional {{[0-9]*}} {{[0-9]*}} {{[0-9]*}}
