summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2017-12-15 00:32:09 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2017-12-15 00:32:09 +0000
commit055a3e3225eb0bb32a14b9986ef88f0ede988d89 (patch)
treebab87fd7b76f8c709162513996b671d4f3e44e0f /test
parent1764ef1f3a7e3df710e492ab0b53fe50b1273ce1 (diff)
FastISel: support no-PLT PIC calls on ELF x86_64
Add support for properly handling PIC code with no-PLT. This equates to `-fpic -fno-plt -O0` with the clang frontend. External functions are marked with nonlazybind, which must then be indirected through the GOT. This allows code to be built without optimizations in PIC mode without going through the PLT. Addresses PR35653! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320776 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/X86/fast-isel-noplt-pic.ll16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/CodeGen/X86/fast-isel-noplt-pic.ll b/test/CodeGen/X86/fast-isel-noplt-pic.ll
new file mode 100644
index 00000000000..575ed365d65
--- /dev/null
+++ b/test/CodeGen/X86/fast-isel-noplt-pic.ll
@@ -0,0 +1,16 @@
+; RUN: llc -mtriple x86_64-unknown-linux-gnu -O0 -fast-isel=true -relocation-model=pic -filetype asm -o - %s | FileCheck %s
+
+declare void @f() local_unnamed_addr #0
+
+define void @g() local_unnamed_addr {
+entry:
+ call void @f()
+ ret void
+}
+
+attributes #0 = { nonlazybind }
+
+; CHECK-LABEL: g:
+; CHECK-LABEL: callq *f@GOTPCREL(%rip)
+; CHECK-LABEL: retq
+