2019-08-10 04:18:30 +08:00
|
|
|
; RUN: llc < %s -mtriple=aarch64-unknown-linux-gnu -filetype=obj -o - \
|
2020-03-16 07:17:52 +08:00
|
|
|
; RUN: | llvm-objdump --triple=aarch64-unknown-linux-gnu -d - \
|
2019-08-10 04:18:30 +08:00
|
|
|
; RUN: | FileCheck %s
|
|
|
|
|
|
|
|
%struct.c = type { i1 (...)* }
|
|
|
|
|
|
|
|
@l = common hidden local_unnamed_addr global i32 0, align 4
|
|
|
|
|
2020-03-06 06:18:38 +08:00
|
|
|
; CHECK-LABEL: <test1>:
|
|
|
|
; CHECK-LABEL: <$d.1>:
|
|
|
|
; CHECK-LABEL: <$x.2>:
|
2020-04-10 09:46:35 +08:00
|
|
|
; CHECK-NEXT: b 0x30 <$x.4+0x4>
|
2020-03-06 06:18:38 +08:00
|
|
|
; CHECK-LABEL: <$x.4>:
|
2020-04-10 09:46:35 +08:00
|
|
|
; CHECK-NEXT: b 0x30 <$x.4+0x4>
|
2019-08-10 04:18:30 +08:00
|
|
|
; CHECK-NEXT: mov w0, wzr
|
|
|
|
; CHECK-NEXT: ldr x30, [sp], #16
|
|
|
|
; CHECK-NEXT: ret
|
|
|
|
define hidden i32 @test1() {
|
|
|
|
%1 = tail call i32 bitcast (i32 (...)* @g to i32 ()*)()
|
|
|
|
%2 = icmp eq i32 %1, 0
|
|
|
|
br i1 %2, label %3, label %5
|
|
|
|
|
|
|
|
3: ; preds = %0
|
|
|
|
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))
|
|
|
|
to label %4 [label %7]
|
|
|
|
|
|
|
|
4: ; preds = %3
|
|
|
|
br label %7
|
|
|
|
|
|
|
|
5: ; preds = %0
|
|
|
|
%6 = tail call i32 bitcast (i32 (...)* @i to i32 ()*)()
|
|
|
|
br label %7
|
|
|
|
|
|
|
|
7: ; preds = %3, %4, %5
|
|
|
|
%8 = phi i32 [ %6, %5 ], [ 0, %4 ], [ 0, %3 ]
|
|
|
|
ret i32 %8
|
|
|
|
}
|
|
|
|
|
|
|
|
declare dso_local i32 @g(...) local_unnamed_addr
|
|
|
|
|
|
|
|
declare dso_local i32 @i(...) local_unnamed_addr
|
|
|
|
|
2020-03-06 06:18:38 +08:00
|
|
|
; CHECK-LABEL: <test2>:
|
2020-04-10 09:46:35 +08:00
|
|
|
; CHECK: bl {{.*}} <test2+0x18>
|
2020-03-06 06:18:38 +08:00
|
|
|
; CHECK-LABEL: <$d.5>:
|
|
|
|
; CHECK-LABEL: <$x.6>:
|
2020-04-10 09:46:35 +08:00
|
|
|
; CHECK-NEXT: b {{.*}} <test2+0x18>
|
2019-08-10 04:18:30 +08:00
|
|
|
define hidden i32 @test2() local_unnamed_addr {
|
|
|
|
%1 = load i32, i32* @l, align 4
|
|
|
|
%2 = icmp eq i32 %1, 0
|
|
|
|
br i1 %2, label %10, label %3
|
|
|
|
|
|
|
|
3: ; preds = %0
|
|
|
|
%4 = tail call i32 bitcast (i32 (...)* @g to i32 ()*)()
|
|
|
|
%5 = icmp eq i32 %4, 0
|
|
|
|
br i1 %5, label %6, label %7
|
|
|
|
|
|
|
|
6: ; preds = %3
|
|
|
|
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))
|
2019-09-26 06:28:27 +08:00
|
|
|
to label %10 [label %7]
|
2019-08-10 04:18:30 +08:00
|
|
|
|
|
|
|
7: ; preds = %3
|
|
|
|
%8 = tail call i32 bitcast (i32 (...)* @i to i32 ()*)()
|
|
|
|
br label %10
|
|
|
|
|
|
|
|
9: ; preds = %6
|
|
|
|
br label %10
|
|
|
|
|
|
|
|
10: ; preds = %7, %0, %6, %9
|
|
|
|
ret i32 undef
|
|
|
|
}
|
|
|
|
|
2020-03-06 06:18:38 +08:00
|
|
|
; CHECK-LABEL: <test3>:
|
|
|
|
; CHECK-LABEL: <$d.9>:
|
|
|
|
; CHECK-LABEL: <$x.10>:
|
2020-04-10 09:46:35 +08:00
|
|
|
; CHECK-NEXT: b {{.*}} <test3+0x18>
|
2020-03-06 06:18:38 +08:00
|
|
|
; CHECK-LABEL: <$x.12>:
|
2020-04-10 09:46:35 +08:00
|
|
|
; CHECK-NEXT: b {{.*}} <$x.12+0x4>
|
2019-08-10 04:18:30 +08:00
|
|
|
; CHECK-NEXT: mov w0, wzr
|
|
|
|
; CHECK-NEXT: ldr x30, [sp], #16
|
|
|
|
; CHECK-NEXT: ret
|
|
|
|
define internal i1 @test3() {
|
|
|
|
%1 = tail call i32 bitcast (i32 (...)* @g to i32 ()*)()
|
|
|
|
%2 = icmp eq i32 %1, 0
|
|
|
|
br i1 %2, label %3, label %5
|
|
|
|
|
|
|
|
3: ; preds = %0
|
|
|
|
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))
|
|
|
|
to label %4 [label %8]
|
|
|
|
|
|
|
|
4: ; preds = %3
|
|
|
|
br label %8
|
|
|
|
|
|
|
|
5: ; preds = %0
|
|
|
|
%6 = tail call i32 bitcast (i32 (...)* @i to i32 ()*)()
|
|
|
|
%7 = icmp ne i32 %6, 0
|
|
|
|
br label %8
|
|
|
|
|
|
|
|
8: ; preds = %3, %4, %5
|
|
|
|
%9 = phi i1 [ %7, %5 ], [ false, %4 ], [ false, %3 ]
|
|
|
|
ret i1 %9
|
|
|
|
}
|