1 ; RUN: llc < %s -mtriple=thumbv7-apple-darwin -relocation-model=pic | FileCheck %s
3 ; Thumb2 target should reorder the bb's in order to use tbb / tbh.
6 %struct.R_flstr = type { i32, i32, i8* }
7 %struct._T_tstr = type { i32, %struct.R_flstr*, %struct._T_tstr* }
8 @_C_nextcmd = external global i32 ; <i32*> [#uses=3]
9 @.str31 = external constant [28 x i8], align 1 ; <[28 x i8]*> [#uses=1]
10 @_T_gtol = external global %struct._T_tstr* ; <%struct._T_tstr**> [#uses=2]
12 declare arm_apcscc i32 @strlen(i8* nocapture) nounwind readonly
14 declare arm_apcscc void @Z_fatal(i8*) noreturn nounwind
16 declare arm_apcscc noalias i8* @calloc(i32, i32) nounwind
18 define arm_apcscc i32 @main(i32 %argc, i8** nocapture %argv) nounwind {
24 bb1.i2: ; preds = %bb42.i
27 bb5.i: ; preds = %bb42.i
28 %0 = or i32 %argc, 32 ; <i32> [#uses=1]
31 bb7.i: ; preds = %bb42.i
32 call arm_apcscc void @_T_addtol(%struct._T_tstr** @_T_gtol, i32 0, i8* null) nounwind
35 bb15.i: ; preds = %bb42.i
36 call arm_apcscc void @_T_addtol(%struct._T_tstr** @_T_gtol, i32 2, i8* null) nounwind
39 bb23.i: ; preds = %bb42.i
40 %1 = call arm_apcscc i32 @strlen(i8* null) nounwind readonly ; <i32> [#uses=0]
43 bb33.i: ; preds = %bb42.i
44 store i32 0, i32* @_C_nextcmd, align 4
45 %2 = call arm_apcscc noalias i8* @calloc(i32 21, i32 1) nounwind ; <i8*> [#uses=0]
48 bb34.i: ; preds = %bb42.i
49 %3 = load i32* @_C_nextcmd, align 4 ; <i32> [#uses=1]
50 %4 = add i32 %3, 1 ; <i32> [#uses=1]
51 store i32 %4, i32* @_C_nextcmd, align 4
52 %5 = call arm_apcscc noalias i8* @calloc(i32 22, i32 1) nounwind ; <i8*> [#uses=0]
55 bb35.i: ; preds = %bb42.i
56 %6 = call arm_apcscc noalias i8* @calloc(i32 20, i32 1) nounwind ; <i8*> [#uses=0]
59 bb37.i: ; preds = %bb42.i
60 %7 = call arm_apcscc noalias i8* @calloc(i32 14, i32 1) nounwind ; <i8*> [#uses=0]
63 bb39.i: ; preds = %bb42.i
64 call arm_apcscc void @Z_fatal(i8* getelementptr ([28 x i8]* @.str31, i32 0, i32 0)) nounwind
67 bb40.i: ; preds = %bb42.i, %bb5.i, %bb1.i2
70 bb42.i: ; preds = %bb40.i, %entry
71 switch i32 %argc, label %bb39.i [
78 i32 101, label %bb40.i
79 i32 102, label %bb23.i
80 i32 105, label %bb15.i
81 i32 116, label %bb1.i2
85 declare arm_apcscc void @_T_addtol(%struct._T_tstr** nocapture, i32, i8*) nounwind