blob: 5aa9a735f250bc44e3ceecd03ecd49ead9d58ada [file] [log] [blame]
Evan Cheng801d98b2012-01-04 01:55:04 +00001; RUN: llc < %s -mtriple=thumbv7-apple-ios | FileCheck %s
Evan Cheng6ddd7bc2009-08-15 07:59:10 +00002
3define void @foo(i32 %X, i32 %Y) {
4entry:
5; CHECK: foo:
6; CHECK: it ne
7; CHECK: cmpne
8; CHECK: it hi
9; CHECK: pophi {r7, pc}
10 %tmp1 = icmp ult i32 %X, 4 ; <i1> [#uses=1]
11 %tmp4 = icmp eq i32 %Y, 0 ; <i1> [#uses=1]
12 %tmp7 = or i1 %tmp4, %tmp1 ; <i1> [#uses=1]
13 br i1 %tmp7, label %cond_true, label %UnifiedReturnBlock
14
15cond_true: ; preds = %entry
Dale Johannesen065d6fd2010-06-04 21:14:24 +000016 %tmp10 = call i32 (...)* @bar( ) ; <i32> [#uses=0]
Evan Cheng6ddd7bc2009-08-15 07:59:10 +000017 ret void
18
19UnifiedReturnBlock: ; preds = %entry
20 ret void
21}
22
23declare i32 @bar(...)
24
25; FIXME: Need post-ifcvt branch folding to get rid of the extra br at end of BB1.
26
27 %struct.quad_struct = type { i32, i32, %struct.quad_struct*, %struct.quad_struct*, %struct.quad_struct*, %struct.quad_struct*, %struct.quad_struct* }
28
29define fastcc i32 @CountTree(%struct.quad_struct* %tree) {
30entry:
31; CHECK: CountTree:
Evan Cheng6ddd7bc2009-08-15 07:59:10 +000032; CHECK: itt eq
33; CHECK: moveq
34; CHECK: popeq
Chandler Carruth4190b502012-04-16 13:49:17 +000035; CHECK: bne
36; CHECK: cmp
37; CHECK: it eq
38; CHECK: cmpeq
Evan Cheng6ddd7bc2009-08-15 07:59:10 +000039 br label %tailrecurse
40
41tailrecurse: ; preds = %bb, %entry
42 %tmp6 = load %struct.quad_struct** null ; <%struct.quad_struct*> [#uses=1]
43 %tmp9 = load %struct.quad_struct** null ; <%struct.quad_struct*> [#uses=2]
44 %tmp12 = load %struct.quad_struct** null ; <%struct.quad_struct*> [#uses=1]
45 %tmp14 = icmp eq %struct.quad_struct* null, null ; <i1> [#uses=1]
46 %tmp17 = icmp eq %struct.quad_struct* %tmp6, null ; <i1> [#uses=1]
47 %tmp23 = icmp eq %struct.quad_struct* %tmp9, null ; <i1> [#uses=1]
48 %tmp29 = icmp eq %struct.quad_struct* %tmp12, null ; <i1> [#uses=1]
49 %bothcond = and i1 %tmp17, %tmp14 ; <i1> [#uses=1]
50 %bothcond1 = and i1 %bothcond, %tmp23 ; <i1> [#uses=1]
51 %bothcond2 = and i1 %bothcond1, %tmp29 ; <i1> [#uses=1]
52 br i1 %bothcond2, label %return, label %bb
53
54bb: ; preds = %tailrecurse
55 %tmp41 = tail call fastcc i32 @CountTree( %struct.quad_struct* %tmp9 ) ; <i32> [#uses=0]
56 br label %tailrecurse
57
58return: ; preds = %tailrecurse
59 ret i32 0
60}
61
62 %struct.SString = type { i8*, i32, i32 }
63
64declare void @abort()
65
66define fastcc void @t1(%struct.SString* %word, i8 signext %c) {
67entry:
68; CHECK: t1:
69; CHECK: it ne
70; CHECK: popne {r7, pc}
71 %tmp1 = icmp eq %struct.SString* %word, null ; <i1> [#uses=1]
72 br i1 %tmp1, label %cond_true, label %cond_false
73
74cond_true: ; preds = %entry
75 tail call void @abort( )
76 unreachable
77
78cond_false: ; preds = %entry
79 ret void
80}
81
82define fastcc void @t2() nounwind {
83entry:
84; CHECK: t2:
85; CHECK: cmp r0, #0
Chandler Carruth1f5580b2012-04-16 22:03:00 +000086; CHECK: %growMapping.exit
Evan Cheng6ddd7bc2009-08-15 07:59:10 +000087 br i1 undef, label %bb.i.i3, label %growMapping.exit
88
89bb.i.i3: ; preds = %entry
90 unreachable
91
92growMapping.exit: ; preds = %entry
93 unreachable
94}