59 lines · plain
1; RUN: llc -mtriple=sparc-none-linux-gnu < %s | FileCheck %s2 3; This test checks that LLVM can do basic stripping and reapplying of branches4; to basic blocks.5 6declare void @test_true()7declare void @test_false()8 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}12 13define void @test_Bcc_fallthrough_taken(i32 %in) nounwind {14; CHECK-LABEL: test_Bcc_fallthrough_taken:15 %tst = icmp eq i32 %in, 4216 br i1 %tst, label %true, label %false, !prof !017 18; CHECK: cmp {{%[goli][0-9]+}}, 4219; CHECK: bne [[FALSE:.LBB[0-9]+_[0-9]+]]20; CHECK-NEXT: nop21; CHECK-NEXT: ! %bb.22; CHECK-NEXT: call test_true23 24; CHECK: [[FALSE]]:25; CHECK: call test_false26 27true:28 call void @test_true()29 ret void30 31false:32 call void @test_false()33 ret void34}35 36define void @test_Bcc_fallthrough_nottaken(i32 %in) nounwind {37; CHECK-LABEL: test_Bcc_fallthrough_nottaken:38 %tst = icmp eq i32 %in, 4239 br i1 %tst, label %true, label %false, !prof !140 41; CHECK: cmp {{%[goli][0-9]+}}, 4242 43; CHECK: be [[TRUE:.LBB[0-9]+_[0-9]+]]44; CHECK-NEXT: nop45; CHECK-NEXT: ! %bb.46; CHECK-NEXT: call test_false47 48; CHECK: [[TRUE]]:49; CHECK: call test_true50 51true:52 call void @test_true()53 ret void54 55false:56 call void @test_false()57 ret void58}59