1 ; RUN: llvm-as %s -o %t.bc 2 ; RUN: llvm-spirv %t.bc -spirv-text -o %t.txt 3 ; RUN: FileCheck < %t.txt %s --check-prefix=CHECK-SPIRV 4 ; RUN: llvm-spirv %t.bc -o %t.spv 5 ; RUN: llvm-spirv -r %t.spv -o %t.rev.bc 6 ; RUN: llvm-dis < %t.rev.bc | FileCheck %s --check-prefix=CHECK-LLVM 7 8 ; CHECK-LLVM: define spir_kernel void @worker(i8 addrspace(3)* dereferenceable(12) %ptr) 9 ; CHECK-LLVM: define spir_func void @not_a_kernel(i8 addrspace(3)* dereferenceable(123) %ptr2) 10 11 ; CHECK-SPIRV: 3 Name [[PTR_ID:[0-9]+]] "ptr" 12 ; CHECK-SPIRV: 4 Name [[PTR2_ID:[0-9]+]] "ptr2" 13 ; CHECK-SPIRV: 4 Decorate [[PTR_ID]] MaxByteOffset 12 14 ; CHECK-SPIRV: 4 Decorate [[PTR2_ID]] MaxByteOffset 123 15 ; CHECK-SPIRV: 4 TypeInt [[CHAR_T:[0-9]+]] 8 0 16 ; CHECK-SPIRV: 4 TypePointer [[CHAR_PTR_T:[0-9]+]] 4 [[CHAR_T]] 17 ; CHECK-SPIRV: 3 FunctionParameter [[CHAR_PTR_T]] [[PTR_ID]] 18 ; CHECK-SPIRV: 3 FunctionParameter [[CHAR_PTR_T]] [[PTR2_ID]] 19 20 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" 21 target triple = "spir-unknown-unknown" 22 23 ; Function Attrs: nounwind 24 define spir_kernel void @worker(i8 addrspace(3)* dereferenceable(12) %ptr) #0 { 25 entry: 26 %ptr.addr = alloca i8 addrspace(3)*, align 4 27 store i8 addrspace(3)* %ptr, i8 addrspace(3)** %ptr.addr, align 4 28 ret void 29 } 30 31 ; Function Attrs: nounwind 32 define spir_func void @not_a_kernel(i8 addrspace(3)* dereferenceable(123) %ptr2) #0 { 33 entry: 34 ret void 35 } 36 37 attributes #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" } 38 39 !opencl.enable.FP_CONTRACT = !{} 40 !opencl.spir.version = !{!0} 41 !opencl.ocl.version = !{!1} 42 !opencl.used.extensions = !{!2} 43 !opencl.used.optional.core.features = !{!2} 44 !opencl.compiler.options = !{!2} 45 !llvm.ident = !{!3} 46 !spirv.Source = !{!4} 47 !spirv.String = !{} 48 49 !0 = !{i32 1, i32 2} 50 !1 = !{i32 2, i32 2} 51 !2 = !{} 52 !3 = !{!"clang version 3.6.1 "} 53 !4 = !{i32 4, i32 202000} 54