• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llvm-as < %s | llvm-spirv -spirv-text -o %t
2; RUN: FileCheck < %t %s
3
4; CHECK-DAG: {{[0-9]*}} Capability Addresses
5
6; ModuleID = 'capbility-kernel.bc'
7target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024"
8target triple = "spir64-unknown-unknown"
9
10; CHECK-DAG: {{[0-9]*}} Capability Linkage
11; Function Attrs: nounwind
12define spir_func void @func_export(i32 addrspace(1)* nocapture %a) #0 {
13entry:
14; CHECK-DAG: {{[0-9]*}} Capability Int64
15  %call = tail call spir_func i64 @_Z13get_global_idj(i32 0) #3
16  %cmp = icmp eq i64 %call, 0
17  br i1 %cmp, label %if.then, label %if.end
18
19if.then:                                          ; preds = %entry
20  store i32 1, i32 addrspace(1)* %a, align 4, !tbaa !9
21  br label %if.end
22
23if.end:                                           ; preds = %if.then, %entry
24  ret void
25}
26
27; Function Attrs: nounwind readnone
28declare spir_func i64 @_Z13get_global_idj(i32) #1
29
30; CHECK-DAG: {{[0-9]*}} Capability Kernel
31; CHECK-NOT: {{[0-9]*}} Capability Shader
32; CHECK-NOT: {{[0-9]*}} Capability Float64
33; Function Attrs: nounwind
34define spir_kernel void @func_kernel(i32 addrspace(1)* %a) #0 {
35entry:
36  tail call spir_func void @func_import(i32 addrspace(1)* %a) #4
37  ret void
38}
39
40declare spir_func void @func_import(i32 addrspace(1)*) #2
41
42attributes #0 = { nounwind "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" }
43attributes #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" }
44attributes #2 = { "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" }
45attributes #3 = { nounwind readnone }
46attributes #4 = { nounwind }
47
48!opencl.kernels = !{!0}
49!opencl.enable.FP_CONTRACT = !{}
50!opencl.spir.version = !{!6}
51!opencl.ocl.version = !{!6}
52!opencl.used.extensions = !{!7}
53!opencl.used.optional.core.features = !{!7}
54!opencl.compiler.options = !{!7}
55!llvm.ident = !{!8}
56
57!0 = !{void (i32 addrspace(1)*)* @func_kernel, !1, !2, !3, !4, !5}
58!1 = !{!"kernel_arg_addr_space", i32 1}
59!2 = !{!"kernel_arg_access_qual", !"none"}
60!3 = !{!"kernel_arg_type", !"int*"}
61!4 = !{!"kernel_arg_type_qual", !""}
62!5 = !{!"kernel_arg_base_type", !"int*"}
63!6 = !{i32 2, i32 0}
64!7 = !{}
65!8 = !{!"clang version 3.4 "}
66!9 = !{!10, !10, i64 0}
67!10 = !{!"int", !11, i64 0}
68!11 = !{!"omnipotent char", !12, i64 0}
69!12 = !{!"Simple C/C++ TBAA"}
70