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