1 ; RUN: llc -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s
2 ; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown %s -o - -filetype=obj | spirv-val %}
4 ; CHECK-DAG: OpCapability Addresses
6 ; CHECK-DAG: OpCapability Linkage
7 define spir_func void @func_export(i32 addrspace(1)* nocapture %a) {
9 ; CHECK-DAG: OpCapability Int64
10 %call = tail call spir_func i64 @_Z13get_global_idj(i32 0)
11 %cmp = icmp eq i64 %call, 0
12 br i1 %cmp, label %if.then, label %if.end
14 if.then: ; preds = %entry
15 store i32 1, i32 addrspace(1)* %a, align 4
18 if.end: ; preds = %if.then, %entry
22 declare spir_func i64 @_Z13get_global_idj(i32)
24 ; CHECK-DAG: OpCapability Kernel
25 ; CHECK-NOT: OpCapability Shader
26 ; CHECK-NOT: OpCapability Float64
27 define spir_kernel void @func_kernel(i32 addrspace(1)* %a) {
29 tail call spir_func void @func_import(i32 addrspace(1)* %a)
33 declare spir_func void @func_import(i32 addrspace(1)*)