1 ; RUN: llc -mtriple=sparc-none-linux-gnu < %s | FileCheck %s
3 ; This test checks that LLVM can do basic stripping and reapplying of branches
6 declare void @test_true()
7 declare void @test_false()
9 ; !0 corresponds to a branch being taken, !1 to not being takne.
10 !0 = !{!"branch_weights", i32 64, i32 4}
11 !1 = !{!"branch_weights", i32 4, i32 64}
13 define void @test_Bcc_fallthrough_taken(i32 %in) nounwind {
14 ; CHECK-LABEL: test_Bcc_fallthrough_taken:
15 %tst = icmp eq i32 %in, 42
16 br i1 %tst, label %true, label %false, !prof !0
18 ; CHECK: cmp {{%[goli][0-9]+}}, 42
19 ; CHECK: bne [[FALSE:.LBB[0-9]+_[0-9]+]]
22 ; CHECK-NEXT: call test_true
25 ; CHECK: call test_false
28 call void @test_true()
32 call void @test_false()
36 define void @test_Bcc_fallthrough_nottaken(i32 %in) nounwind {
37 ; CHECK-LABEL: test_Bcc_fallthrough_nottaken:
38 %tst = icmp eq i32 %in, 42
39 br i1 %tst, label %true, label %false, !prof !1
41 ; CHECK: cmp {{%[goli][0-9]+}}, 42
43 ; CHECK: be [[TRUE:.LBB[0-9]+_[0-9]+]]
46 ; CHECK-NEXT: call test_false
49 ; CHECK: call test_true
52 call void @test_true()
56 call void @test_false()