1 ; RUN: llc -march=r600 -mcpu=SI -mattr=-promote-alloca -verify-machineinstrs < %s
3 ; Test that CopyToReg instructions don't have non-register operands prior
6 ; Make sure this doesn't crash
7 ; CHECK-LABEL: {{^}}copy_to_reg_frameindex:
8 define void @copy_to_reg_frameindex(i32 addrspace(1)* %out, i32 %a, i32 %b, i32 %c) {
10 %alloca = alloca [16 x i32]
14 %inc = phi i32 [0, %entry], [%inc.i, %loop]
15 %ptr = getelementptr [16 x i32]* %alloca, i32 0, i32 %inc
16 store i32 %inc, i32* %ptr
17 %inc.i = add i32 %inc, 1
18 %cnd = icmp uge i32 %inc.i, 16
19 br i1 %cnd, label %done, label %loop
22 %tmp0 = getelementptr [16 x i32]* %alloca, i32 0, i32 0
23 %tmp1 = load i32* %tmp0
24 store i32 %tmp1, i32 addrspace(1)* %out