blob: 2cf1d6a2afd3db1c7ee8b1ccae88e719d6d1282e [file] [log] [blame]
Dan Gohmanda594cf2009-09-09 00:09:15 +00001; RUN: llc < %s -mtriple=thumbv7-apple-darwin -relocation-model=pic | FileCheck %s
Evan Cheng1b2b3e22009-07-29 02:18:14 +00002
Evan Chenge12c92d2009-07-29 23:20:20 +00003; Thumb2 target should reorder the bb's in order to use tbb / tbh.
4
Evan Cheng1b2b3e22009-07-29 02:18:14 +00005 %struct.R_flstr = type { i32, i32, i8* }
6 %struct._T_tstr = type { i32, %struct.R_flstr*, %struct._T_tstr* }
7@_C_nextcmd = external global i32 ; <i32*> [#uses=3]
8@.str31 = external constant [28 x i8], align 1 ; <[28 x i8]*> [#uses=1]
9@_T_gtol = external global %struct._T_tstr* ; <%struct._T_tstr**> [#uses=2]
10
11declare arm_apcscc i32 @strlen(i8* nocapture) nounwind readonly
12
13declare arm_apcscc void @Z_fatal(i8*) noreturn nounwind
14
15declare arm_apcscc noalias i8* @calloc(i32, i32) nounwind
16
17define arm_apcscc i32 @main(i32 %argc, i8** nocapture %argv) nounwind {
18; CHECK: main:
Jim Grosbache8ffe252009-11-12 17:19:09 +000019; CHECK: tbb
Evan Cheng1b2b3e22009-07-29 02:18:14 +000020entry:
21 br label %bb42.i
22
23bb1.i2: ; preds = %bb42.i
24 br label %bb40.i
25
26bb5.i: ; preds = %bb42.i
Jim Grosbache8ffe252009-11-12 17:19:09 +000027 %0 = or i32 %argc, 32 ; <i32> [#uses=1]
Evan Cheng1b2b3e22009-07-29 02:18:14 +000028 br label %bb40.i
29
30bb7.i: ; preds = %bb42.i
31 call arm_apcscc void @_T_addtol(%struct._T_tstr** @_T_gtol, i32 0, i8* null) nounwind
32 unreachable
33
34bb15.i: ; preds = %bb42.i
35 call arm_apcscc void @_T_addtol(%struct._T_tstr** @_T_gtol, i32 2, i8* null) nounwind
36 unreachable
37
38bb23.i: ; preds = %bb42.i
39 %1 = call arm_apcscc i32 @strlen(i8* null) nounwind readonly ; <i32> [#uses=0]
40 unreachable
41
42bb33.i: ; preds = %bb42.i
43 store i32 0, i32* @_C_nextcmd, align 4
44 %2 = call arm_apcscc noalias i8* @calloc(i32 21, i32 1) nounwind ; <i8*> [#uses=0]
45 unreachable
46
47bb34.i: ; preds = %bb42.i
48 %3 = load i32* @_C_nextcmd, align 4 ; <i32> [#uses=1]
49 %4 = add i32 %3, 1 ; <i32> [#uses=1]
50 store i32 %4, i32* @_C_nextcmd, align 4
51 %5 = call arm_apcscc noalias i8* @calloc(i32 22, i32 1) nounwind ; <i8*> [#uses=0]
52 unreachable
53
54bb35.i: ; preds = %bb42.i
55 %6 = call arm_apcscc noalias i8* @calloc(i32 20, i32 1) nounwind ; <i8*> [#uses=0]
56 unreachable
57
58bb37.i: ; preds = %bb42.i
59 %7 = call arm_apcscc noalias i8* @calloc(i32 14, i32 1) nounwind ; <i8*> [#uses=0]
60 unreachable
61
62bb39.i: ; preds = %bb42.i
63 call arm_apcscc void @Z_fatal(i8* getelementptr ([28 x i8]* @.str31, i32 0, i32 0)) nounwind
64 unreachable
65
66bb40.i: ; preds = %bb42.i, %bb5.i, %bb1.i2
Evan Cheng1b2b3e22009-07-29 02:18:14 +000067 br label %bb42.i
68
69bb42.i: ; preds = %bb40.i, %entry
Jim Grosbache8ffe252009-11-12 17:19:09 +000070 switch i32 %argc, label %bb39.i [
Evan Cheng1b2b3e22009-07-29 02:18:14 +000071 i32 67, label %bb33.i
72 i32 70, label %bb35.i
73 i32 77, label %bb37.i
74 i32 83, label %bb34.i
75 i32 97, label %bb7.i
76 i32 100, label %bb5.i
77 i32 101, label %bb40.i
78 i32 102, label %bb23.i
79 i32 105, label %bb15.i
80 i32 116, label %bb1.i2
81 ]
82}
83
84declare arm_apcscc void @_T_addtol(%struct._T_tstr** nocapture, i32, i8*) nounwind