Skip to content

Commit

Permalink
update test case
Browse files Browse the repository at this point in the history
  • Loading branch information
VyacheslavLevytskyy committed Oct 11, 2024
1 parent bd9bcea commit db9f367
Showing 1 changed file with 17 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,30 @@
; CHECK-DAG: OpCapability FunctionPointersINTEL
; CHECK-DAG: OpCapability Int64
; CHECK: OpExtension "SPV_INTEL_function_pointers"
; CHECK-DAG: %[[TyInt8:.*]] = OpTypeInt 8 0

; CHECK-DAG: OpName %[[fp:.*]] "fp"
; CHECK-DAG: OpName %[[data:.*]] "data"
; CHECK-DAG: OpName %[[bar:.*]] "bar"
; CHECK-DAG: OpName %[[test:.*]] "test"
; CHECK-DAG: %[[TyVoid:.*]] = OpTypeVoid
; CHECK-DAG: %[[TyFloat32:.*]] = OpTypeFloat 32
; CHECK-DAG: %[[TyInt8:.*]] = OpTypeInt 8 0
; CHECK-DAG: %[[TyInt64:.*]] = OpTypeInt 64 0
; CHECK-DAG: %[[TyPtrInt8:.*]] = OpTypePointer Function %[[TyInt8]]
; CHECK-DAG: %[[TyFunFp:.*]] = OpTypeFunction %[[TyFloat32]] %[[TyPtrInt8]]
; CHECK-DAG: %[[TyFunBar:.*]] = OpTypeFunction %[[TyInt64]] %[[TyPtrInt8]] %[[TyPtrInt8]]
; CHECK-DAG: %[[TyPtrFunFp:.*]] = OpTypePointer Function %[[TyFunFp]]
; CHECK-DAG: %[[TyPtrFunBar:.*]] = OpTypePointer Function %[[TyFunBar]]
; CHECK-DAG: %[[TyFunTest:.*]] = OpTypeFunction %[[TyVoid]] %[[TyPtrInt8]] %[[TyPtrInt8]] %[[TyPtrInt8]]
; CHECK: %[[FunTest:.*]] = OpFunction %[[TyVoid]] None %[[TyFunTest]]
; CHECK: %[[ArgFp:.*]] = OpFunctionParameter %[[TyPtrInt8]]
; CHECK: %[[ArgData:.*]] = OpFunctionParameter %[[TyPtrInt8]]
; CHECK: %[[ArgBar:.*]] = OpFunctionParameter %[[TyPtrInt8]]
; CHECK: OpFunctionPointerCallINTEL %[[TyFloat32]] %[[ArgFp]] %[[ArgBar]]
; CHECK: OpFunctionPointerCallINTEL %[[TyInt64]] %[[ArgBar]] %[[ArgFp]] %[[ArgData]]
; CHECK-DAG: %[[TyFp:.*]] = OpTypeFunction %[[TyFloat32]] %[[TyPtrInt8]]
; CHECK-DAG: %[[TyPtrFp:.*]] = OpTypePointer Function %[[TyFp]]
; CHECK-DAG: %[[TyBar:.*]] = OpTypeFunction %[[TyInt64]] %[[TyPtrFp]] %[[TyPtrInt8]]
; CHECK-DAG: %[[TyPtrBar:.*]] = OpTypePointer Function %[[TyBar]]
; CHECK-DAG: %[[TyTest:.*]] = OpTypeFunction %[[TyVoid]] %[[TyPtrFp]] %[[TyPtrInt8]] %[[TyPtrBar]]
; CHECK: %[[test]] = OpFunction %[[TyVoid]] None %[[TyTest]]
; CHECK: %[[fp]] = OpFunctionParameter %[[TyPtrFp]]
; CHECK: %[[data]] = OpFunctionParameter %[[TyPtrInt8]]
; CHECK: %[[bar]] = OpFunctionParameter %[[TyPtrBar]]
; CHECK: OpFunctionPointerCallINTEL %[[TyFloat32]] %[[fp]] %[[bar]]
; CHECK: OpFunctionPointerCallINTEL %[[TyInt64]] %[[bar]] %[[fp]] %[[data]]
; CHECK: OpReturn
; CHECK: OpFunctionEnd

target triple = "spir64-unknown-unknown"

define spir_kernel void @test(ptr %fp, ptr %data, ptr %bar) {
entry:
%0 = call spir_func float %fp(ptr %bar)
Expand Down

0 comments on commit db9f367

Please sign in to comment.