Debian Codegraph @

llvm-project/llvm/projects/llvm-spirv/test/image_decl_func_arg.ll

raw
1 ; RUN: llvm-as -opaque-pointers=0 %s -o %t.bc
2 ; RUN: llvm-spirv %t.bc -opaque-pointers=0 -spirv-text -o %t.spt
3 ; RUN: FileCheck < %t.spt %s --check-prefix=CHECK-SPIRV
4 ; RUN: llvm-spirv %t.bc -opaque-pointers=0 -o %t.spv
5 ; RUN: spirv-val %t.spv
6
7 ; CHECK-SPIRV: {{[0-9]*}} TypeImage [[TypeImage:[0-9]+]]
8 ; CHECK-SPIRV-NOT: {{[0-9]*}} TypeImage
9 ; CHECK-SPIRV: {{[0-9]*}} TypeFunction {{[0-9]*}} {{[0-9]*}} [[TypeImage]]
10 ; CHECK-SPIRV: {{[0-9]*}} TypeFunction {{[0-9]*}} {{[0-9]*}} [[TypeImage]]
11 ; CHECK-SPIRV: {{[0-9]*}} FunctionParameter [[TypeImage]] {{[0-9]*}}
12 ; CHECK-SPIRV: {{[0-9]*}} FunctionParameter [[TypeImage]] {{[0-9]*}}
13 ; CHECK-SPIRV: {{[0-9]*}} FunctionParameter [[TypeImage]] [[ParamID:[0-9]+]]
14 ; CHECK-SPIRV: {{[0-9]*}} FunctionCall {{[0-9]*}} {{[0-9]*}} {{[0-9]*}} [[ParamID]]
15
16 ; ModuleID = 'test.cl.bc'
17 target 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"
18 target triple = "spir-unknown-unknown"
19
20 %opencl.image2d_ro_t = type opaque
21
22 ; Function Attrs: nounwind
23 define spir_func void @f0(%opencl.image2d_ro_t addrspace(1)* %v2, <2 x float> %v3) #0 {
24 entry:
25 ret void
26 }
27
28 ; Function Attrs: nounwind
29 define spir_func void @f1(%opencl.image2d_ro_t addrspace(1)* %v2, <2 x float> %v3) #0 {
30 entry:
31 ret void
32 }
33
34 ; Function Attrs: nounwind
35 define spir_kernel void @test(%opencl.image2d_ro_t addrspace(1)* %v1) #0 !kernel_arg_addr_space !1 !kernel_arg_access_qual !2 !kernel_arg_type !3 !kernel_arg_base_type !5 !kernel_arg_type_qual !4 {
36 entry:
37 call spir_func void @f0(%opencl.image2d_ro_t addrspace(1)* %v1, <2 x float> <float 1.000000e+00, float 5.000000e+00>) #0
38 ret void
39 }
40
41 attributes #0 = { nounwind }
42
43 !opencl.enable.FP_CONTRACT = !{}
44 !spirv.Source = !{!6}
45 !opencl.spir.version = !{!7}
46 !opencl.ocl.version = !{!7}
47 !opencl.used.extensions = !{!8}
48 !opencl.used.optional.core.features = !{!9}
49 !spirv.Generator = !{!10}
50
51 !1 = !{i32 1}
52 !2 = !{!"read_only"}
53 !3 = !{!"image2d_t"}
54 !4 = !{!""}
55 !5 = !{!"image2d_t"}
56 !6 = !{i32 3, i32 200000}
57 !7 = !{i32 2, i32 0}
58 !8 = !{}
59 !9 = !{!"cl_images"}
60 !10 = !{i16 6, i16 14}