1 ; RUN: llc -march=mipsel -relocation-model=pic -O0 -fast-isel-abort=3 -mcpu=mips32r2 \
2 ; RUN: < %s -verify-machineinstrs | FileCheck %s
4 %struct.x = type { i32 }
6 @i = common global i32 0, align 4
8 define i32 @foobar(i32 signext %x) {
10 ; CHECK-LABEL: foobar:
11 %retval = alloca i32, align 4
12 %x.addr = alloca i32, align 4
13 %a = alloca %struct.x, align 8
14 %c = alloca ptr, align 8
15 store i32 %x, ptr %x.addr, align 4
16 %0 = load i32, ptr %x.addr, align 4
17 store i32 %0, ptr %a, align 4
18 store ptr %a, ptr %c, align 4
19 %1 = load ptr, ptr %c, align 4
20 %2 = load i32, ptr %1, align 4
21 store i32 %2, ptr @i, align 4
22 %3 = load i32, ptr %retval
23 ; CHECK: addiu $[[A_ADDR:[0-9]+]], $sp, 8
24 ; CHECK-DAG: lw $[[I_ADDR:[0-9]+]], %got(i)($[[REG_GP:[0-9]+]])
25 ; CHECK-DAG: sw $[[A_ADDR]], [[A_ADDR_FI:[0-9]+]]($sp)
26 ; CHECK-DAG: lw $[[A_ADDR2:[0-9]+]], [[A_ADDR_FI]]($sp)
27 ; CHECK-DAG: lw $[[A_X:[0-9]+]], 0($[[A_ADDR2]])
28 ; CHECK-DAG: sw $[[A_X]], 0($[[I_ADDR]])