Files
clang-p2996/llvm/test/CodeGen/SPIRV/function/internal-anonymous-function.ll
Michal Paszkowski 7a3c9a85c5 [SPIRV] Fix call lowering of "anonymous" functions
The patch fixes lowering of anonymous functions, removes file/linkage
info for builtin call demangling, and adds relevant test demonstrating
a fixed problem.

Differential Revision: https://reviews.llvm.org/D135390
2022-10-11 00:06:29 +02:00

21 lines
604 B
LLVM

; RUN: llc -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s
;; Types:
; CHECK-DAG: %[[#F32:]] = OpTypeFloat 32
; CHECK-DAG: %[[#FNF32:]] = OpTypeFunction %[[#F32]] %[[#F32]]
;; Function decl:
; CHECK: %[[#ANON:]] = OpFunction %[[#F32]] None %[[#FNF32]]
; CHECK-NEXT: OpFunctionParameter %[[#F32]]
; CHECK-NEXT: OpLabel
; CHECK-NEXT: OpReturnValue
; CHECK-NEXT: OpFunctionEnd
define internal spir_func float @0(float %a) {
ret float %a
}
; CHECK: OpFunctionCall %[[#F32]] %[[#ANON]]
define spir_kernel void @foo(float %a) {
%1 = call spir_func float @0(float %a)
ret void
}