summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/X86/tail-call-got.ll
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2011-08-11 01:48:05 +0000
committerEli Friedman <eli.friedman@gmail.com>2011-08-11 01:48:05 +0000
commit3ae39f8ad150f689b359b172ef4bdc41f47e9981 (patch)
treeafc58033203941836e8962a79a5cb7826172cb82 /llvm/test/CodeGen/X86/tail-call-got.ll
parente1894cf97cc1f264ad3469e06f122cd8d995c3c8 (diff)
downloadbcm5719-llvm-3ae39f8ad150f689b359b172ef4bdc41f47e9981.tar.gz
bcm5719-llvm-3ae39f8ad150f689b359b172ef4bdc41f47e9981.zip
Fix X86TargetLowering::LowerExternalSymbol so that it actually works in non-trivial cases. This hasn't been an issue before because the function isn't normally called (but apparently is used to generate a tail-call to sin() on ELF x86-32 with PIC and SSE2).
Fixes PR9693. llvm-svn: 137292
Diffstat (limited to 'llvm/test/CodeGen/X86/tail-call-got.ll')
-rw-r--r--llvm/test/CodeGen/X86/tail-call-got.ll24
1 files changed, 24 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/tail-call-got.ll b/llvm/test/CodeGen/X86/tail-call-got.ll
new file mode 100644
index 00000000000..8910ee272db
--- /dev/null
+++ b/llvm/test/CodeGen/X86/tail-call-got.ll
@@ -0,0 +1,24 @@
+; RUN: llc < %s -relocation-model=pic | FileCheck %s
+
+target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32"
+target triple = "i386-unknown-freebsd9.0"
+
+define double @test1(double %x) nounwind readnone {
+; CHECK: test1:
+; CHECK: movl foo@GOT
+; CHECK-NEXT: jmpl
+ %1 = tail call double @foo(double %x) nounwind readnone
+ ret double %1
+}
+
+declare double @foo(double) readnone
+
+define double @test2(double %x) nounwind readnone {
+; CHECK: test2:
+; CHECK: movl sin@GOT
+; CHECK-NEXT: jmpl
+ %1 = tail call double @sin(double %x) nounwind readnone
+ ret double %1
+}
+
+declare double @sin(double) readnone
OpenPOWER on IntegriCloud