Flip the new block-placement pass to be on by default.
[oota-llvm.git] / test / CodeGen / Thumb2 / thumb2-branch.ll
1 ; RUN: llc < %s -mtriple=thumbv7-apple-darwin -mattr=+thumb2 | FileCheck %s
2 ; If-conversion defeats the purpose of this test, which is to check conditional
3 ; branch generation, so use memory barrier instruction to make sure it doesn't
4 ; happen and we get actual branches.
5
6 define i32 @f1(i32 %a, i32 %b, i32* %v) {
7 entry:
8 ; CHECK: f1:
9 ; CHECK: bne LBB
10         %tmp = icmp eq i32 %a, %b               ; <i1> [#uses=1]
11         br i1 %tmp, label %cond_true, label %return
12
13 cond_true:              ; preds = %entry
14         fence seq_cst
15         store i32 0, i32* %v
16         ret i32 0
17
18 return:         ; preds = %entry
19         fence seq_cst
20         ret i32 1
21 }
22
23 define i32 @f2(i32 %a, i32 %b, i32* %v) {
24 entry:
25 ; CHECK: f2:
26 ; CHECK: bge LBB
27         %tmp = icmp slt i32 %a, %b              ; <i1> [#uses=1]
28         br i1 %tmp, label %cond_true, label %return
29
30 cond_true:              ; preds = %entry
31         fence seq_cst
32         store i32 0, i32* %v
33         ret i32 0
34
35 return:         ; preds = %entry
36         fence seq_cst
37         ret i32 1
38 }
39
40 define i32 @f3(i32 %a, i32 %b, i32* %v) {
41 entry:
42 ; CHECK: f3:
43 ; CHECK: bhs LBB
44         %tmp = icmp ult i32 %a, %b              ; <i1> [#uses=1]
45         br i1 %tmp, label %cond_true, label %return
46
47 cond_true:              ; preds = %entry
48         fence seq_cst
49         store i32 0, i32* %v
50         ret i32 0
51
52 return:         ; preds = %entry
53         fence seq_cst
54         ret i32 1
55 }
56
57 define i32 @f4(i32 %a, i32 %b, i32* %v) {
58 entry:
59 ; CHECK: f4:
60 ; CHECK: blo LBB
61         %tmp = icmp uge i32 %a, %b              ; <i1> [#uses=1]
62         br i1 %tmp, label %cond_true, label %return
63
64 cond_true:              ; preds = %entry
65         fence seq_cst
66         store i32 0, i32* %v
67         ret i32 0
68
69 return:         ; preds = %entry
70         fence seq_cst
71         ret i32 1
72 }