1 ; RUN: llc -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s
3 ; CHECK: %[[#int_32:]] = OpTypeInt 32 0
4 ; CHECK: %[[#bool:]] = OpTypeBool
5 ; CHECK: %[[#zero:]] = OpConstant %[[#int_32]] 0
6 ; CHECK: %[[#one:]] = OpConstant %[[#int_32]] 1
9 ; CHECK: %[[#A:]] = OpFunctionParameter %[[#]]
10 ; CHECK: %[[#B:]] = OpFunctionParameter %[[#]]
11 ; CHECK: %[[#cmp_res:]] = OpSGreaterThan %[[#bool]] %[[#B]] %[[#zero]]
12 ; CHECK: %[[#select_res:]] = OpSelect %[[#int_32]] %[[#cmp_res]] %[[#one]] %[[#zero]]
13 ; CHECK: %[[#stof_res:]] = OpConvertSToF %[[#]] %[[#select_res]]
14 ; CHECK: OpStore %[[#A]] %[[#stof_res]]
16 define dso_local spir_kernel void @K(float addrspace(1)* nocapture %A, i32 %B) local_unnamed_addr {
18 %cmp = icmp sgt i32 %B, 0
19 %conv = sitofp i1 %cmp to float
20 store float %conv, float addrspace(1)* %A, align 4