1; RUN: llc -march=amdgcn -mcpu=gfx908 -verify-machineinstrs < %s | FileCheck -check-prefixes=GCN,GFX908 %s
2; RUN: llc -march=amdgcn -mcpu=gfx900 -verify-machineinstrs < %s | FileCheck -check-prefixes=GCN,GFX900 %s
3
4define void @foo() {
5bb:
6  ret void
7}
8
9; FIXME: We spill v40 into AGPR, but still save and restore FP
10; which is not needed in this case.
11
12; GCN-LABEL: {{^}}caller:
13
14; GCN:     v_writelane_b32 v2, s33, 2
15; GCN:     s_mov_b32 s33, s32
16; GFX900:     buffer_store_dword
17; GFX908-DAG: v_accvgpr_write_b32
18; GCN:        s_swappc_b64
19; GFX900:     buffer_load_dword
20; GFX908:     v_accvgpr_read_b32
21; GCN:        v_readlane_b32 s33, v2, 2
22define i64 @caller() {
23bb:
24  call void asm sideeffect "", "~{v40}" ()
25  tail call void @foo()
26  ret i64 0
27}
28