blob: 6c6347edcee36156666ab3f599771b02e09599cc [file] [log] [blame]
Chris Lattnerc635d712006-09-13 05:59:25 +00001; RUN: llvm-as < %s | llc -relocation-model=dynamic-no-pic -mtriple=i686-apple-darwin8.7.2 | grep L_Arr.non_lazy_ptr &&
2; RUN: llvm-as < %s | llc -relocation-model=dynamic-no-pic -mtriple=i686-apple-darwin8.7.2 | %prcontext L_Arr.non_lazy_ptr 1 | grep '4(%esp)'
3
4%Arr = external global [0 x int] ; <[0 x int]*> [#uses=2]
5
6implementation ; Functions:
7
8void %foo(int %N) {
9entry:
10 %N = cast int %N to uint ; <uint> [#uses=1]
11 br label %cond_true
12
13cond_true: ; preds = %cond_true, %entry
14 %indvar = phi uint [ 0, %entry ], [ %indvar.next, %cond_true ] ; <uint> [#uses=3]
15 %i.0.0 = cast uint %indvar to int ; <int> [#uses=1]
16 %tmp = getelementptr [0 x int]* %Arr, int 0, uint %indvar ; <int*> [#uses=1]
17 store int %i.0.0, int* %tmp
18 %indvar.next = add uint %indvar, 1 ; <uint> [#uses=2]
19 %exitcond = seteq uint %indvar.next, %N ; <bool> [#uses=1]
20 br bool %exitcond, label %return, label %cond_true
21
22return: ; preds = %cond_true, %entry
23 ret void
24}
25