1 ; RUN: llc < %s -mtriple=arm-apple-darwin -relocation-model=dynamic-no-pic -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-LABEL: tail_duplicate_me:
19 ; CHECK: movw r{{[0-9]+}}, :lower16:_GHJK
20 ; CHECK: movt r{{[0-9]+}}, :upper16:_GHJK
24 ; CHECK: movw r{{[0-9]+}}, :lower16:_GHJK
25 ; CHECK: movt r{{[0-9]+}}, :upper16:_GHJK
28 ; CHECK: movw r{{[0-9]+}}, :lower16:_GHJK
29 ; CHECK: movt r{{[0-9]+}}, :upper16:_GHJK
33 define void @tail_duplicate_me() nounwind {
36 %c = call i8* @choose(i8* blockaddress(@tail_duplicate_me, %return),
37 i8* blockaddress(@tail_duplicate_me, %altret))
38 br i1 %a, label %A, label %next
41 br i1 %b, label %B, label %C
45 store i32 0, i32* @GHJK
50 store i32 0, i32* @GHJK
55 store i32 0, i32* @GHJK
59 indirectbr i8* %c, [label %return, label %altret]
62 call void @ear(i32 1000)
65 call void @far(i32 1001)