1 ; RUN: llc < %s -mtriple=arm-apple-darwin -mcpu=cortex-a8 -asm-verbose=false | FileCheck %s
12 declare i8* @choose(i8*, i8*)
14 ; BranchFolding should tail-duplicate the indirect jump to avoid
15 ; redundant branching.
17 ; CHECK: tail_duplicate_me:
20 ; CHECK: ldr r{{.}}, LCPI
23 ; CHECK: ldr r{{.}}, LCPI
26 ; CHECK: ldr r{{.}}, LCPI
30 define void @tail_duplicate_me() nounwind {
33 %c = call i8* @choose(i8* blockaddress(@tail_duplicate_me, %return),
34 i8* blockaddress(@tail_duplicate_me, %altret))
35 br i1 %a, label %A, label %next
38 br i1 %b, label %B, label %C
42 store i32 0, i32* @GHJK
47 store i32 0, i32* @GHJK
52 store i32 0, i32* @GHJK
56 indirectbr i8* %c, [label %return, label %altret]
59 call void @ear(i32 1000)
62 call void @far(i32 1001)