FileCheck-ize a couple tests.
[oota-llvm.git] / test / CodeGen / Thumb2 / thumb2-bcc.ll
1 ; RUN: llc < %s -march=thumb -mattr=+thumb2 | FileCheck %s
2 ; RUN: llc < %s -march=thumb -mattr=+thumb2 | not grep it
3 ; If-conversion defeats the purpose of this test, which is to check CBZ
4 ; generation, so use memory barrier instruction to make sure it doesn't
5 ; happen and we get actual branches.
6
7 define i32 @t1(i32 %a, i32 %b, i32 %c) {
8 ; CHECK: t1:
9 ; CHECK: cbz
10         %tmp2 = icmp eq i32 %a, 0
11         br i1 %tmp2, label %cond_false, label %cond_true
12
13 cond_true:
14         call void @llvm.memory.barrier(i1 true, i1 true, i1 true, i1 true, i1 false)
15         %tmp5 = add i32 %b, 1
16         %tmp6 = and i32 %tmp5, %c
17         ret i32 %tmp6
18
19 cond_false:
20         call void @llvm.memory.barrier(i1 true, i1 true, i1 true, i1 true, i1 false)
21         %tmp7 = add i32 %b, -1
22         %tmp8 = xor i32 %tmp7, %c
23         ret i32 %tmp8
24 }
25
26 declare void @llvm.memory.barrier(i1, i1, i1, i1, i1) nounwind