[WinEH] Add some test cases I forgot to add to previous commits
[oota-llvm.git] / test / CodeGen / AArch64 / fast-isel-branch-cond-split.ll
1 ; RUN: llc -mtriple=aarch64-apple-darwin -fast-isel -fast-isel-abort=1 -verify-machineinstrs < %s | FileCheck %s
2
3 ; CHECK-label: test_or
4 ; CHECK:       cbnz w0, {{LBB[0-9]+_2}}
5 ; CHECK:       cbz w1, {{LBB[0-9]+_1}}
6 define i64 @test_or(i32 %a, i32 %b) {
7 bb1:
8   %0 = icmp eq i32 %a, 0
9   %1 = icmp eq i32 %b, 0
10   %or.cond = or i1 %0, %1
11   br i1 %or.cond, label %bb3, label %bb4, !prof !0
12
13 bb3:
14   ret i64 0
15
16 bb4:
17   %2 = call i64 @bar()
18   ret i64 %2
19 }
20
21 ; CHECK-label: test_ans
22 ; CHECK:       cbz w0, {{LBB[0-9]+_2}}
23 ; CHECK:       cbnz w1, {{LBB[0-9]+_3}}
24 define i64 @test_and(i32 %a, i32 %b) {
25 bb1:
26   %0 = icmp ne i32 %a, 0
27   %1 = icmp ne i32 %b, 0
28   %or.cond = and i1 %0, %1
29   br i1 %or.cond, label %bb4, label %bb3, !prof !1
30
31 bb3:
32   ret i64 0
33
34 bb4:
35   %2 = call i64 @bar()
36   ret i64 %2
37 }
38
39 declare i64 @bar()
40
41 !0 = !{!"branch_weights", i32 5128, i32 32}
42 !1 = !{!"branch_weights", i32 1024, i32 4136}