1 ; RUN: llc -O0 -mtriple=spirv32-unknown-unknown %s -o - | FileCheck %s
3 ;; FIXME: Are there any attributes that would make the IR invalid for SPIR-V?
6 ; CHECK-DAG: OpName %[[#FN1:]] "fn1"
7 ; CHECK-DAG: OpName %[[#FN2:]] "fn2"
8 ; CHECK-DAG: OpName %[[#FN3:]] "fn3"
9 ; CHECK-DAG: OpName %[[#FN4:]] "fn4"
10 ; CHECK-DAG: OpName %[[#FN5:]] "fn5"
11 ; CHECK-DAG: OpName %[[#FN6:]] "fn6"
12 ; CHECK-DAG: OpName %[[#FN7:]] "fn7"
13 ; CHECK-DAG: OpName %[[#FN8:]] "fn8"
14 ; CHECK-DAG: OpName %[[#FN9:]] "fn9"
17 ; CHECK: %[[#VOID:]] = OpTypeVoid
18 ; CHECK: %[[#FN:]] = OpTypeFunction %[[#VOID]]
23 define void @fn1() noinline {
26 ; CHECK: %[[#FN1]] = OpFunction %[[#VOID]] DontInline %[[#FN]]
27 ; CHECK-NOT: OpFunctionParameter
28 ; CHECK: OpFunctionEnd
31 attributes #0 = { noinline }
32 define void @fn2() #0 {
35 ; CHECK: %[[#FN2]] = OpFunction %[[#VOID]] DontInline %[[#FN]]
36 ; CHECK: OpFunctionEnd
39 define void @fn3() alwaysinline {
42 ; CHECK: %[[#FN3]] = OpFunction %[[#VOID]] Inline %[[#FN]]
43 ; CHECK: OpFunctionEnd
46 ;; NOTE: inlinehint is not an actual requirement.
47 define void @fn4() inlinehint {
50 ; CHECK: %[[#FN4]] = OpFunction %[[#VOID]] None %[[#FN]]
51 ; CHECK: OpFunctionEnd
54 define void @fn5() readnone {
57 ; CHECK: %[[#FN5]] = OpFunction %[[#VOID]] Pure %[[#FN]]
58 ; CHECK: OpFunctionEnd
61 define void @fn6() memory(none) {
64 ; CHECK: %[[#FN6]] = OpFunction %[[#VOID]] Pure %[[#FN]]
65 ; CHECK: OpFunctionEnd
68 define void @fn7() readonly {
71 ; CHECK: %[[#FN7]] = OpFunction %[[#VOID]] Const %[[#FN]]
72 ; CHECK: OpFunctionEnd
75 define void @fn8() memory(read) {
78 ; CHECK: %[[#FN8]] = OpFunction %[[#VOID]] Const %[[#FN]]
79 ; CHECK: OpFunctionEnd
82 define void @fn9() alwaysinline readnone {
85 ; CHECK: %[[#FN9]] = OpFunction %[[#VOID]] Inline|Pure %[[#FN]]
86 ; CHECK: OpFunctionEnd