2017-04-18 02:18:47 +08:00
|
|
|
; RUN: llc -mtriple=aarch64-apple-ios %s -o - -aarch64-enable-nonlazybind | FileCheck %s
|
|
|
|
; RUN: llc -mtriple=aarch64-apple-ios %s -o - | FileCheck %s --check-prefix=CHECK-NORMAL
|
2017-04-18 01:27:56 +08:00
|
|
|
|
|
|
|
define void @local() nonlazybind {
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
declare void @nonlocal() nonlazybind
|
|
|
|
|
|
|
|
define void @test_laziness() {
|
|
|
|
; CHECK-LABEL: test_laziness:
|
|
|
|
|
|
|
|
; CHECK: bl _local
|
|
|
|
|
|
|
|
; CHECK: adrp x[[TMP:[0-9]+]], _nonlocal@GOTPAGE
|
|
|
|
; CHECK: ldr [[FUNC:x[0-9]+]], [x[[TMP]], _nonlocal@GOTPAGEOFF]
|
|
|
|
; CHECK: blr [[FUNC]]
|
|
|
|
|
2017-04-18 02:18:47 +08:00
|
|
|
; CHECK-NORMAL-LABEL: test_laziness:
|
|
|
|
; CHECK-NORMAL: bl _local
|
|
|
|
; CHEKC-NORMAL: bl _nonlocal
|
|
|
|
|
2017-04-18 01:27:56 +08:00
|
|
|
call void @local()
|
|
|
|
call void @nonlocal()
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @test_laziness_tail() {
|
|
|
|
; CHECK-LABEL: test_laziness_tail:
|
|
|
|
|
|
|
|
; CHECK: adrp x[[TMP:[0-9]+]], _nonlocal@GOTPAGE
|
|
|
|
; CHECK: ldr [[FUNC:x[0-9]+]], [x[[TMP]], _nonlocal@GOTPAGEOFF]
|
|
|
|
; CHECK: br [[FUNC]]
|
|
|
|
|
2017-04-18 02:18:47 +08:00
|
|
|
; CHECK-NORMAL-LABEL: test_laziness_tail:
|
|
|
|
; CHECK-NORMAL: b _nonlocal
|
|
|
|
|
2017-04-18 01:27:56 +08:00
|
|
|
tail call void @nonlocal()
|
|
|
|
ret void
|
|
|
|
}
|