1 ; RUN: llvm-upgrade %s | llvm-as -f -o %t.bc
2 ; RUN: lli %t.bc > /dev/null
4 %.LC0 = internal global [10 x sbyte] c"argc: %d\0A\00"
6 implementation ; Functions:
8 declare int %puts(sbyte*)
10 void %getoptions(int* %argc) {
11 bb0: ; No predecessors!
15 declare int %printf(sbyte*, ...)
17 int %main(int %argc, sbyte** %argv) {
18 bb0: ; No predecessors!
19 call int (sbyte*, ...)* %printf( sbyte* getelementptr ([10 x sbyte]* %.LC0, long 0, long 0), int %argc)
20 %cast224 = cast sbyte** %argv to sbyte* ; <sbyte*> [#uses=1]
21 %local = alloca sbyte* ; <sbyte**> [#uses=3]
22 store sbyte* %cast224, sbyte** %local
23 %cond226 = setle int %argc, 0 ; <bool> [#uses=1]
24 br bool %cond226, label %bb3, label %bb2
26 bb2: ; preds = %bb2, %bb0
27 %cann-indvar = phi int [ 0, %bb0 ], [ %add1-indvar, %bb2 ] ; <int> [#uses=2]
28 %add1-indvar = add int %cann-indvar, 1 ; <int> [#uses=2]
29 %cann-indvar-idxcast = cast int %cann-indvar to long ; <long> [#uses=1]
30 ;%reg115 = load sbyte** %local ; <sbyte*> [#uses=1]
31 ;%cann-indvar-idxcast-scale = mul long %cann-indvar-idxcast, 8 ; <long> [#uses=1]
32 ;%reg232 = getelementptr sbyte* %reg115, long %cann-indvar-idxcast-scale ; <sbyte*> [#uses=1]
33 ;%cast235 = cast sbyte* %reg232 to sbyte** ; <sbyte**> [#uses=1]
34 %CT = cast sbyte** %local to sbyte***
35 %reg115 = load sbyte*** %CT
36 %cast235 = getelementptr sbyte** %reg115, long %cann-indvar-idxcast
38 %reg117 = load sbyte** %cast235 ; <sbyte*> [#uses=1]
39 %reg236 = call int %puts( sbyte* %reg117 ) ; <int> [#uses=0]
40 %cond239 = setlt int %add1-indvar, %argc ; <bool> [#uses=1]
41 br bool %cond239, label %bb2, label %bb3
43 bb3: ; preds = %bb2, %bb0
44 %cast243 = cast sbyte** %local to int* ; <int*> [#uses=1]
45 call void %getoptions( int* %cast243 )