diff options
| author | Andrew Trick <atrick@apple.com> | 2015-02-05 18:09:05 +0000 |
|---|---|---|
| committer | Andrew Trick <atrick@apple.com> | 2015-02-05 18:09:05 +0000 |
| commit | 7fc4583eda562daf9d3610d6e2623c60ca0690f6 (patch) | |
| tree | b40f3cb0a6c321722f4a7e9476e656603d1e349d /llvm/test/CodeGen/X86/sret-implicit.ll | |
| parent | f297dbed487cd02514ee3e022c89dc2242475465 (diff) | |
| download | bcm5719-llvm-7fc4583eda562daf9d3610d6e2623c60ca0690f6.tar.gz bcm5719-llvm-7fc4583eda562daf9d3610d6e2623c60ca0690f6.zip | |
X86 ABI fix for return values > 24 bytes.
The return value's address must be returned in %rax.
i.e. the callee needs to copy the sret argument (%rdi)
into the return value (%rax).
This probably won't manifest as a bug when the caller is LLVM-compiled
code. But it is an ABI guarantee and tools expect it.
llvm-svn: 228321
Diffstat (limited to 'llvm/test/CodeGen/X86/sret-implicit.ll')
| -rw-r--r-- | llvm/test/CodeGen/X86/sret-implicit.ll | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/sret-implicit.ll b/llvm/test/CodeGen/X86/sret-implicit.ll new file mode 100644 index 00000000000..3fade1de0cf --- /dev/null +++ b/llvm/test/CodeGen/X86/sret-implicit.ll @@ -0,0 +1,10 @@ +; RUN: llc -mtriple=x86_64-apple-darwin8 < %s | FileCheck %s +; RUN: llc -mtriple=x86_64-pc-linux < %s | FileCheck %s + +; CHECK-LABEL: return32 +; CHECK-DAG: movq $0, (%rdi) +; CHECK-DAG: movq %rdi, %rax +; CHECK: retq +define i256 @return32() { + ret i256 0 +} |

