summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen
diff options
context:
space:
mode:
authorJohannes Doerfert <jdoerfert@anl.gov>2019-06-04 20:34:43 +0000
committerJohannes Doerfert <jdoerfert@anl.gov>2019-06-04 20:34:43 +0000
commit6b432dca5d4aa6bea8a39e7858f8cfd19f2b87ed (patch)
treed0438462d908535c0dc778db5d36fbf8f7d9d52b /llvm/test/CodeGen
parent40107ce753ff172f76ceb67da2817868f952c003 (diff)
downloadbcm5719-llvm-6b432dca5d4aa6bea8a39e7858f8cfd19f2b87ed.tar.gz
bcm5719-llvm-6b432dca5d4aa6bea8a39e7858f8cfd19f2b87ed.zip
[SelectionDAG][FIX] Allow "returned" arguments to be bit-casted
Summary: An argument that is return by a function but bit-casted before can still be annotated as "returned". Make sure we do not crash for this case. Reviewers: sunfish, stephenwlin, niravd, arsenm Subscribers: wdng, hiraditya, bollu, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59917 llvm-svn: 362546
Diffstat (limited to 'llvm/test/CodeGen')
-rw-r--r--llvm/test/CodeGen/X86/arg_returned_bitcast.ll12
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/arg_returned_bitcast.ll b/llvm/test/CodeGen/X86/arg_returned_bitcast.ll
new file mode 100644
index 00000000000..2287c129b75
--- /dev/null
+++ b/llvm/test/CodeGen/X86/arg_returned_bitcast.ll
@@ -0,0 +1,12 @@
+; RUN: llc < %s -mtriple=i686-unknown-linux-gnu | FileCheck %s
+
+; Test that the "returned" attribute "works" even if there is a bitcast between
+; the argument and return value.
+
+declare double* @bar(i8* returned)
+
+define double* @foo(i8*) {
+ %r = tail call double* @bar(i8* %0)
+; CHECK: jmp bar
+ ret double* %r
+}
OpenPOWER on IntegriCloud