summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen
diff options
context:
space:
mode:
authorSriraman Tallam <tmsriram@google.com>2017-11-03 00:10:19 +0000
committerSriraman Tallam <tmsriram@google.com>2017-11-03 00:10:19 +0000
commit7cdb10f1aabfe57b3e1dcb1a8e5a064b1c7343dc (patch)
tree475276bd49c074f4c0042ba07d0c35bf4f901701 /llvm/test/CodeGen
parent19bbd8a92d8e8aca0a24f27f6c9d18dcdecf4fd9 (diff)
downloadbcm5719-llvm-7cdb10f1aabfe57b3e1dcb1a8e5a064b1c7343dc.tar.gz
bcm5719-llvm-7cdb10f1aabfe57b3e1dcb1a8e5a064b1c7343dc.zip
Avoid PLT for external calls when attribute nonlazybind is used.
Differential Revision: https://reviews.llvm.org/D39065 llvm-svn: 317292
Diffstat (limited to 'llvm/test/CodeGen')
-rw-r--r--llvm/test/CodeGen/X86/no-plt.ll23
1 files changed, 23 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/no-plt.ll b/llvm/test/CodeGen/X86/no-plt.ll
new file mode 100644
index 00000000000..77ef686cc85
--- /dev/null
+++ b/llvm/test/CodeGen/X86/no-plt.ll
@@ -0,0 +1,23 @@
+; RUN: llc < %s -mcpu=generic -mtriple=x86_64-linux-gnu -relocation-model=pic \
+; RUN: | FileCheck -check-prefix=X64 %s
+; RUN: llc < %s -mcpu=generic -mtriple=x86_64-linux-gnu \
+; RUN: | FileCheck -check-prefix=X64 %s
+
+define i32 @main() #0 {
+; X64: callq *_Z3foov@GOTPCREL(%rip)
+; X64: callq _Z3barv
+
+entry:
+ %retval = alloca i32, align 4
+ store i32 0, i32* %retval, align 4
+ %call1 = call i32 @_Z3foov()
+ %call2 = call i32 @_Z3barv()
+ ret i32 0
+}
+
+; Function Attrs: nonlazybind
+declare i32 @_Z3foov() #1
+
+declare i32 @_Z3barv() #2
+
+attributes #1 = { nonlazybind }
OpenPOWER on IntegriCloud