1; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -amdgpu-stress-function-calls -amdgpu-always-inline %s | FileCheck %s
2
3; CHECK: define internal fastcc i32 @alwaysinline_func(i32 %a) #0 {
4define internal fastcc i32 @alwaysinline_func(i32 %a) alwaysinline {
5entry:
6  %tmp0 = add i32 %a, 1
7  ret i32 %tmp0
8}
9
10; CHECK: define internal fastcc i32 @noinline_func(i32 %a) #1 {
11define internal fastcc i32 @noinline_func(i32 %a) noinline {
12entry:
13  %tmp0 = add i32 %a, 2
14  ret i32 %tmp0
15}
16
17; CHECK: define internal fastcc i32 @unmarked_func(i32 %a) #1 {
18define internal fastcc i32 @unmarked_func(i32 %a) {
19entry:
20  %tmp0 = add i32 %a, 3
21  ret i32 %tmp0
22}
23
24define amdgpu_kernel void @kernel(i32 addrspace(1)* %out) {
25entry:
26  %tmp0 = call i32 @alwaysinline_func(i32 1)
27  store volatile i32 %tmp0, i32 addrspace(1)* %out
28  %tmp1 = call i32 @noinline_func(i32 1)
29  store volatile i32 %tmp1, i32 addrspace(1)* %out
30  %tmp2 = call i32 @unmarked_func(i32 1)
31  store volatile i32 %tmp2, i32 addrspace(1)* %out
32  ret void
33}
34
35; CHECK: attributes #0 = { alwaysinline }
36; CHECK: attributes #1 = { noinline }
37