1 ; RUN: llvm-as < %s | llc -mtriple=thumbv7-apple-darwin -relocation-model=pic | FileCheck %s
3 ; Thumb2 target should reorder the bb's in order to use tbb / tbh.
7 %struct.R_flstr = type { i32, i32, i8* }
8 %struct._T_tstr = type { i32, %struct.R_flstr*, %struct._T_tstr* }
9 @_C_nextcmd = external global i32 ; <i32*> [#uses=3]
10 @.str31 = external constant [28 x i8], align 1 ; <[28 x i8]*> [#uses=1]
11 @_T_gtol = external global %struct._T_tstr* ; <%struct._T_tstr**> [#uses=2]
13 declare arm_apcscc i32 @strlen(i8* nocapture) nounwind readonly
15 declare arm_apcscc void @Z_fatal(i8*) noreturn nounwind
17 declare arm_apcscc noalias i8* @calloc(i32, i32) nounwind
19 define arm_apcscc i32 @main(i32 %argc, i8** nocapture %argv) nounwind {
25 bb1.i2: ; preds = %bb42.i
28 bb5.i: ; preds = %bb42.i
29 %0 = or i32 %_Y_flags.1, 32 ; <i32> [#uses=1]
32 bb7.i: ; preds = %bb42.i
33 call arm_apcscc void @_T_addtol(%struct._T_tstr** @_T_gtol, i32 0, i8* null) nounwind
36 bb15.i: ; preds = %bb42.i
37 call arm_apcscc void @_T_addtol(%struct._T_tstr** @_T_gtol, i32 2, i8* null) nounwind
40 bb23.i: ; preds = %bb42.i
41 %1 = call arm_apcscc i32 @strlen(i8* null) nounwind readonly ; <i32> [#uses=0]
44 bb33.i: ; preds = %bb42.i
45 store i32 0, i32* @_C_nextcmd, align 4
46 %2 = call arm_apcscc noalias i8* @calloc(i32 21, i32 1) nounwind ; <i8*> [#uses=0]
49 bb34.i: ; preds = %bb42.i
50 %3 = load i32* @_C_nextcmd, align 4 ; <i32> [#uses=1]
51 %4 = add i32 %3, 1 ; <i32> [#uses=1]
52 store i32 %4, i32* @_C_nextcmd, align 4
53 %5 = call arm_apcscc noalias i8* @calloc(i32 22, i32 1) nounwind ; <i8*> [#uses=0]
56 bb35.i: ; preds = %bb42.i
57 %6 = call arm_apcscc noalias i8* @calloc(i32 20, i32 1) nounwind ; <i8*> [#uses=0]
60 bb37.i: ; preds = %bb42.i
61 %7 = call arm_apcscc noalias i8* @calloc(i32 14, i32 1) nounwind ; <i8*> [#uses=0]
64 bb39.i: ; preds = %bb42.i
65 call arm_apcscc void @Z_fatal(i8* getelementptr ([28 x i8]* @.str31, i32 0, i32 0)) nounwind
68 bb40.i: ; preds = %bb42.i, %bb5.i, %bb1.i2
69 %_Y_flags.0 = phi i32 [ 0, %bb1.i2 ], [ %0, %bb5.i ], [ %_Y_flags.1, %bb42.i ] ; <i32> [#uses=1]
70 %_Y_eflag.b.0 = phi i1 [ %_Y_eflag.b.1, %bb1.i2 ], [ %_Y_eflag.b.1, %bb5.i ], [ true, %bb42.i ] ; <i1> [#uses=1]
73 bb42.i: ; preds = %bb40.i, %entry
74 %_Y_eflag.b.1 = phi i1 [ false, %entry ], [ %_Y_eflag.b.0, %bb40.i ] ; <i1> [#uses=2]
75 %_Y_flags.1 = phi i32 [ 0, %entry ], [ %_Y_flags.0, %bb40.i ] ; <i32> [#uses=2]
76 switch i32 undef, label %bb39.i [
83 i32 101, label %bb40.i
84 i32 102, label %bb23.i
85 i32 105, label %bb15.i
86 i32 116, label %bb1.i2
90 declare arm_apcscc void @_T_addtol(%struct._T_tstr** nocapture, i32, i8*) nounwind