1; RUN: llvm-as < %s | llvm-spirv -spirv-text -o %t 2; RUN: FileCheck < %t %s 3 4; ModuleID = 'test.cl' 5target datalayout = "e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024" 6target triple = "spir-unknown-unknown" 7 8; CHECK: {{[0-9]+}} Name [[WD:[0-9]+]] "__spirv_BuiltInWorkDim" 9; CHECK: {{[0-9]+}} Name [[GS:[0-9]+]] "__spirv_BuiltInGlobalSize" 10; CHECK: {{[0-9]+}} Name [[GII:[0-9]+]] "__spirv_BuiltInGlobalInvocationId" 11; CHECK: {{[0-9]+}} Name [[WS:[0-9]+]] "__spirv_BuiltInWorkgroupSize" 12; CHECK: {{[0-9]+}} Name [[EWS:[0-9]+]] "__spirv_BuiltInEnqueuedWorkgroupSize" 13; CHECK: {{[0-9]+}} Name [[LLI:[0-9]+]] "__spirv_BuiltInLocalInvocationId" 14; CHECK: {{[0-9]+}} Name [[NW:[0-9]+]] "__spirv_BuiltInNumWorkgroups" 15; CHECK: {{[0-9]+}} Name [[WI:[0-9]+]] "__spirv_BuiltInWorkgroupId" 16; CHECK: {{[0-9]+}} Name [[GO:[0-9]+]] "__spirv_BuiltInGlobalOffset" 17; CHECK: {{[0-9]+}} Name [[GLI:[0-9]+]] "__spirv_BuiltInGlobalLinearId" 18; CHECK: {{[0-9]+}} Name [[LLII:[0-9]+]] "__spirv_BuiltInLocalInvocationIndex" 19; CHECK: {{[0-9]+}} Name [[SS:[0-9]+]] "__spirv_BuiltInSubgroupSize" 20; CHECK: {{[0-9]+}} Name [[SMS:[0-9]+]] "__spirv_BuiltInSubgroupMaxSize" 21; CHECK: {{[0-9]+}} Name [[NS:[0-9]+]] "__spirv_BuiltInNumSubgroups" 22; CHECK: {{[0-9]+}} Name [[NES:[0-9]+]] "__spirv_BuiltInNumEnqueuedSubgroups" 23; CHECK: {{[0-9]+}} Name [[SI:[0-9]+]] "__spirv_BuiltInSubgroupId" 24; CHECK: {{[0-9]+}} Name [[SLII:[0-9]+]] "__spirv_BuiltInSubgroupLocalInvocationId" 25 26; CHECK: 4 Decorate [[NW]] BuiltIn 24 27; CHECK: 4 Decorate [[WS]] BuiltIn 25 28; CHECK: 4 Decorate [[WI]] BuiltIn 26 29; CHECK: 4 Decorate [[LLI]] BuiltIn 27 30; CHECK: 4 Decorate [[GII]] BuiltIn 28 31; CHECK: 4 Decorate [[LLII]] BuiltIn 29 32; CHECK: 4 Decorate [[WD]] BuiltIn 30 33; CHECK: 4 Decorate [[GS]] BuiltIn 31 34; CHECK: 4 Decorate [[EWS]] BuiltIn 32 35; CHECK: 4 Decorate [[GO]] BuiltIn 33 36; CHECK: 4 Decorate [[GLI]] BuiltIn 34 37; CHECK: 4 Decorate [[SS]] BuiltIn 36 38; CHECK: 4 Decorate [[SMS]] BuiltIn 37 39; CHECK: 4 Decorate [[NS]] BuiltIn 38 40; CHECK: 4 Decorate [[NES]] BuiltIn 39 41; CHECK: 4 Decorate [[SI]] BuiltIn 40 42; CHECK: 4 Decorate [[SLII]] BuiltIn 41 43@__spirv_BuiltInWorkDim = external addrspace(1) global i32 44@__spirv_BuiltInGlobalSize = external addrspace(1) global <3 x i32> 45@__spirv_BuiltInGlobalInvocationId = external addrspace(1) global <3 x i32> 46@__spirv_BuiltInWorkgroupSize = external addrspace(1) global <3 x i32> 47@__spirv_BuiltInEnqueuedWorkgroupSize = external addrspace(1) global <3 x i32> 48@__spirv_BuiltInLocalInvocationId = external addrspace(1) global <3 x i32> 49@__spirv_BuiltInNumWorkgroups = external addrspace(1) global <3 x i32> 50@__spirv_BuiltInWorkgroupId = external addrspace(1) global <3 x i32> 51@__spirv_BuiltInGlobalOffset = external addrspace(1) global <3 x i32> 52@__spirv_BuiltInGlobalLinearId = external addrspace(1) global i32 53@__spirv_BuiltInLocalInvocationIndex = external addrspace(1) global i32 54@__spirv_BuiltInSubgroupSize = external addrspace(1) global i32 55@__spirv_BuiltInSubgroupMaxSize = external addrspace(1) global i32 56@__spirv_BuiltInNumSubgroups = external addrspace(1) global i32 57@__spirv_BuiltInNumEnqueuedSubgroups = external addrspace(1) global i32 58@__spirv_BuiltInSubgroupId = external addrspace(1) global i32 59@__spirv_BuiltInSubgroupLocalInvocationId = external addrspace(1) global i32 60 61; Function Attrs: nounwind readnone 62define spir_kernel void @_Z1wv() #1 { 63entry: 64 ret void 65} 66 67attributes #0 = { alwaysinline nounwind readonly "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-realign-stack" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } 68attributes #1 = { nounwind readnone "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-realign-stack" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } 69 70!opencl.kernels = !{!0} 71!opencl.enable.FP_CONTRACT = !{} 72!opencl.spir.version = !{!6} 73!opencl.ocl.version = !{!7} 74!opencl.used.extensions = !{!8} 75!opencl.used.optional.core.features = !{!8} 76!opencl.compiler.options = !{!8} 77!llvm.ident = !{!9} 78!spirv.Source = !{!10} 79!spirv.String = !{!11} 80 81!0 = !{void ()* @_Z1wv, !1, !2, !3, !4, !5} 82!1 = !{!"kernel_arg_addr_space"} 83!2 = !{!"kernel_arg_access_qual"} 84!3 = !{!"kernel_arg_type"} 85!4 = !{!"kernel_arg_base_type"} 86!5 = !{!"kernel_arg_type_qual"} 87!6 = !{i32 1, i32 2} 88!7 = !{i32 2, i32 1} 89!8 = !{} 90!9 = !{!"clang version 3.6.1 "} 91!10 = !{i32 3, i32 200000, !11} 92!11 = !{!"test.cl"} 93!12 = !{!13, !13, i64 0} 94!13 = !{!"int", !14, i64 0} 95!14 = !{!"omnipotent char", !15, i64 0} 96!15 = !{!"Simple C/C++ TBAA"} 97