1 ; RUN: llc < %s -mtriple=aarch64-unknown-linux-gnu -filetype=obj -o - \
2 ; RUN: | llvm-objdump -triple aarch64-unknown-linux-gnu -d - \
5 %struct.c = type { i1 (...)* }
7 @l = common hidden local_unnamed_addr global i32 0, align 4
12 ; CHECK-NEXT: b #16 <$x.4+0x4>
14 ; CHECK-NEXT: b #4 <$x.4+0x4>
15 ; CHECK-NEXT: mov w0, wzr
16 ; CHECK-NEXT: ldr x30, [sp], #16
18 define hidden i32 @test1() {
19 %1 = tail call i32 bitcast (i32 (...)* @g to i32 ()*)()
20 %2 = icmp eq i32 %1, 0
21 br i1 %2, label %3, label %5
24 callbr void asm sideeffect "1: nop\0A\09.quad a\0A\09b ${1:l}\0A\09.quad ${0:c}", "i,X"(i32* null, i8* blockaddress(@test1, %7))
25 to label %4 [label %7]
31 %6 = tail call i32 bitcast (i32 (...)* @i to i32 ()*)()
34 7: ; preds = %3, %4, %5
35 %8 = phi i32 [ %6, %5 ], [ 0, %4 ], [ 0, %3 ]
39 declare dso_local i32 @g(...) local_unnamed_addr
41 declare dso_local i32 @i(...) local_unnamed_addr
44 ; CHECK: bl #0 <test2+0x10>
47 ; CHECK-NEXT: b #16 <$x.8+0x4>
48 define hidden i32 @test2() local_unnamed_addr {
49 %1 = load i32, i32* @l, align 4
50 %2 = icmp eq i32 %1, 0
51 br i1 %2, label %10, label %3
54 %4 = tail call i32 bitcast (i32 (...)* @g to i32 ()*)()
55 %5 = icmp eq i32 %4, 0
56 br i1 %5, label %6, label %7
59 callbr void asm sideeffect "1: nop\0A\09.quad b\0A\09b ${1:l}\0A\09.quad ${0:c}", "i,X"(i32* null, i8* blockaddress(@test2, %7))
60 to label %10 [label %7]
63 %8 = tail call i32 bitcast (i32 (...)* @i to i32 ()*)()
69 10: ; preds = %7, %0, %6, %9
76 ; CHECK-NEXT: b #20 <$x.12+0x8>
78 ; CHECK-NEXT: b #4 <$x.12+0x4>
79 ; CHECK-NEXT: mov w0, wzr
80 ; CHECK-NEXT: ldr x30, [sp], #16
82 define internal i1 @test3() {
83 %1 = tail call i32 bitcast (i32 (...)* @g to i32 ()*)()
84 %2 = icmp eq i32 %1, 0
85 br i1 %2, label %3, label %5
88 callbr void asm sideeffect "1: nop\0A\09.quad c\0A\09b ${1:l}\0A\09.quad ${0:c}", "i,X"(i32* null, i8* blockaddress(@test3, %8))
89 to label %4 [label %8]
95 %6 = tail call i32 bitcast (i32 (...)* @i to i32 ()*)()
96 %7 = icmp ne i32 %6, 0
99 8: ; preds = %3, %4, %5
100 %9 = phi i1 [ %7, %5 ], [ false, %4 ], [ false, %3 ]