1; RUN: llc -mtriple=amdgcn-amd-amdhsa -amdgpu-function-calls < %s | FileCheck -check-prefix=CALLS %s
2; RUN: llc -mtriple=amdgcn-amd-amdhsa < %s | FileCheck -check-prefix=CALLS %s
3; RUN: llc -mtriple=amdgcn-amd-amdhsa -amdgpu-function-calls=0 < %s | FileCheck -check-prefix=NOCALLS %s
4; RUN: llc -mtriple=r600-mesa-mesa3d < %s | FileCheck -check-prefix=NOCALLS %s
5; RUN: llc -mtriple=r600-mesa-mesa3d -amdgpu-function-calls=0 < %s | FileCheck -check-prefix=NOCALLS %s
6
7; CALLS-LABEL: callee:
8; CALLS: ;;#ASMSTART
9; CALLS: ;;#ASMEND
10
11; NOCALLS-NOT: callee
12; R600-NOT: callee
13define internal void @callee() {
14  call void asm sideeffect "", ""()
15  ret void
16}
17
18; CALLS-LABEL: kernel:
19; CALLS: s_swappc_b64
20
21; NOCALLS-LABEL: kernel:
22; NOCALLS: ;;#ASMSTART
23; NOCALLS: ;;#ASMEND
24define amdgpu_kernel void @kernel() {
25  call void @callee()
26  ret void
27}
28