summaryrefslogtreecommitdiff
path: root/test/CodeGen/AArch64/nonlazybind.ll
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-04-20 21:19:10 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-04-20 21:19:10 +0000
commitd99dafe2e4a385dd2a6c76da6d8258deb100657b (patch)
treeba60bf957558bd114f25dbff3d4996b5d7a61c82 /test/CodeGen/AArch64/nonlazybind.ll
parent71d5a2540a98c81f5bcaeb48805e0e2881f530ef (diff)
Notes
Diffstat (limited to 'test/CodeGen/AArch64/nonlazybind.ll')
-rw-r--r--test/CodeGen/AArch64/nonlazybind.ll40
1 files changed, 40 insertions, 0 deletions
diff --git a/test/CodeGen/AArch64/nonlazybind.ll b/test/CodeGen/AArch64/nonlazybind.ll
new file mode 100644
index 000000000000..4355d45fe84d
--- /dev/null
+++ b/test/CodeGen/AArch64/nonlazybind.ll
@@ -0,0 +1,40 @@
+; 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
+
+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]]
+
+; CHECK-NORMAL-LABEL: test_laziness:
+; CHECK-NORMAL: bl _local
+; CHEKC-NORMAL: bl _nonlocal
+
+ 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]]
+
+; CHECK-NORMAL-LABEL: test_laziness_tail:
+; CHECK-NORMAL: b _nonlocal
+
+ tail call void @nonlocal()
+ ret void
+}