1; RUN: llc -mtriple amdgcn-amd-- -mcpu=bonaire -verify-machineinstrs < %s | FileCheck -check-prefix=GCN %s
2
3; Before the fix that this test was committed with, this code would leave
4; an unused stack slot, causing ScratchSize to be non-zero.
5
6; GCN-LABEL: store_v3i32:
7; GCN:        ds_read_b96
8; GCN:        ds_write_b96
9; GCN: ScratchSize: 0
10define amdgpu_kernel void @store_v3i32(<3 x i32> addrspace(3)* %out, <3 x i32> %a) nounwind {
11  %val = load <3 x i32>, <3 x i32> addrspace(3)* %out
12  %val.1 = add <3 x i32> %a, %val
13  store <3 x i32> %val.1, <3 x i32> addrspace(3)* %out, align 16
14  ret void
15}
16
17; GCN-LABEL: store_v5i32:
18; GCN:        ds_read_b32
19; GCN:        ds_read_b128
20; GCN:        ds_write_b32
21; GCN:        ds_write_b128
22; GCN: ScratchSize: 0
23define amdgpu_kernel void @store_v5i32(<5 x i32> addrspace(3)* %out, <5 x i32> %a) nounwind {
24  %val = load <5 x i32>, <5 x i32> addrspace(3)* %out
25  %val.1 = add <5 x i32> %a, %val
26  store <5 x i32> %val.1, <5 x i32> addrspace(3)* %out, align 16
27  ret void
28}
29