Debian Codegraph @

llvm/test/CodeGen/SPIRV/function/trivial-function-with-call.ll

raw
1 ; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv32-unknown-unknown %s -o - | FileCheck %s
2
3 ;; Debug info:
4 ; CHECK: OpName %[[#FOO:]] "foo"
5 ; CHECK: OpName %[[#BAR:]] "bar"
6
7 ;; Types:
8 ; CHECK-DAG: %[[#I32:]] = OpTypeInt 32
9 ; CHECK-DAG: %[[#VOID:]] = OpTypeVoid
10 ; CHECK-DAG: %[[#FNVOID:]] = OpTypeFunction %[[#VOID]] %[[#I32]]
11 ; CHECK-DAG: %[[#FNI32:]] = OpTypeFunction %[[#I32]] %[[#I32]]
12 ;; Function decl:
13 ; CHECK: %[[#BAR]] = OpFunction %[[#I32]] None %[[#FNI32]]
14 ; CHECK-NEXT: OpFunctionParameter %[[#I32]]
15 ; CHECK-NEXT: OpFunctionEnd
16 declare i32 @bar(i32 %x)
17 ;; Function def:
18 ; CHECK: %[[#FOO]] = OpFunction %[[#VOID]] None %[[#FNVOID]]
19 ; CHECK: OpFunctionParameter
20 ; CHECK: OpLabel
21 ; CHECK: OpFunctionCall %[[#I32]] %[[#BAR]]
22 ; CHECK: OpReturn
23 ; CHECK-NOT: OpLabel
24 ; CHECK: OpFunctionEnd
25 define spir_func void @foo(i32 %x) {
26 %call1 = call spir_func i32 @bar(i32 %x)
27 ret void
28 }