37 lines · plain
1; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s2 3;; Types:4; CHECK-DAG: %[[#I32:]] = OpTypeInt 325; CHECK-DAG: %[[#F32:]] = OpTypeFloat 326; CHECK-DAG: %[[#FNI32:]] = OpTypeFunction %[[#I32]] %[[#I32]]7; CHECK-DAG: %[[#FNF32:]] = OpTypeFunction %[[#F32]] %[[#F32]]8 9;; Function declarations:10; CHECK: %[[#ANON0:]] = OpFunction %[[#I32]] None %[[#FNI32]]11; CHECK-NEXT: OpFunctionParameter %[[#I32]]12; CHECK-NEXT: OpLabel13; CHECK-NEXT: OpReturnValue14; CHECK-NEXT: OpFunctionEnd15define internal spir_func i32 @0(i32 %a) {16 ret i32 %a17}18 19; CHECK: %[[#ANON1:]] = OpFunction %[[#F32]] None %[[#FNF32]]20; CHECK-NEXT: OpFunctionParameter %[[#F32]]21; CHECK-NEXT: OpLabel22; CHECK-NEXT: OpReturnValue23; CHECK-NEXT: OpFunctionEnd24define internal spir_func float @1(float %a) {25 ret float %a26}27 28;; Calls:29; CHECK: OpFunctionCall %[[#I32]] %[[#ANON0]]30; CHECK: OpFunctionCall %[[#F32]] %[[#ANON1]]31define spir_kernel void @foo(i32 %a) {32 %call1 = call spir_func i32 @0(i32 %a)33 %b = sitofp i32 %a to float34 %call2 = call spir_func float @1(float %b)35 ret void36}37