1 ; RUN: llc -march=mipsel -relocation-model=pic < %s | FileCheck %s
3 @g1 = external global i32*
6 ; CHECK: lw ${{[0-9]+}}, %got(g1)
12 %b = alloca [16 x i32], align 4
13 %0 = bitcast [16 x i32]* %b to i8*
14 call void @llvm.lifetime.start.p0i8(i64 64, i8* %0)
15 %arraydecay = getelementptr inbounds [16 x i32], [16 x i32]* %b, i32 0, i32 0
18 for.body: ; preds = %for.body, %entry
19 %i.05 = phi i32 [ 0, %entry ], [ %inc, %for.body ]
20 %v.04 = phi i32 [ 0, %entry ], [ %add, %for.body ]
21 %1 = load i32*, i32** @g1, align 4
22 %arrayidx = getelementptr inbounds i32, i32* %1, i32 %i.05
23 %2 = load i32, i32* %arrayidx, align 4
24 %call = call i32 @foo2(i32 %2, i32* %arraydecay)
25 %add = add nsw i32 %call, %v.04
26 %inc = add nsw i32 %i.05, 1
27 %exitcond = icmp eq i32 %inc, 10000
28 br i1 %exitcond, label %for.end, label %for.body
30 for.end: ; preds = %for.body
31 call void @llvm.lifetime.end.p0i8(i64 64, i8* %0)
35 declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture)
37 declare i32 @foo2(i32, i32*)
39 declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture)