1 ; RUN: llc -O0 -mtriple=spirv64-unknown-linux %s -o - | FileCheck %s
2 ; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown %s -o - -filetype=obj | spirv-val %}
4 ; CHECK: OpDecorate %[[#FUNC_NAME:]] LinkageAttributes "_Z10BitReversei"
5 ; CHECK-NOT: OpBitReverse
6 ; CHECK: %[[#]] = OpFunctionCall %[[#]] %[[#FUNC_NAME]]
8 %"class._ZTSZ4mainE3$_0.anon" = type { i8 }
10 $_Z10BitReversei = comdat any
12 define dso_local spir_kernel void @_ZTSZ4mainE15kernel_function() {
14 %call = call spir_func i32 @_Z10BitReversei(i32 1)
18 declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture)
20 declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture)
22 define linkonce_odr dso_local spir_func i32 @_Z10BitReversei(i32 %value) comdat {
24 %value.addr = alloca i32, align 4
25 %reversed = alloca i32, align 4
26 store i32 %value, i32* %value.addr, align 4
27 %0 = bitcast i32* %reversed to i8*
28 call void @llvm.lifetime.start.p0i8(i64 4, i8* %0)
29 store i32 0, i32* %reversed, align 4
30 %1 = load i32, i32* %reversed, align 4
31 %2 = bitcast i32* %reversed to i8*
32 call void @llvm.lifetime.end.p0i8(i64 4, i8* %2)