diff options
| author | Evan Cheng <evan.cheng@apple.com> | 2010-03-05 08:38:04 +0000 |
|---|---|---|
| committer | Evan Cheng <evan.cheng@apple.com> | 2010-03-05 08:38:04 +0000 |
| commit | 654ec2a663c91061966d773d5ac97e0a330e5729 (patch) | |
| tree | bf1d34fbc24b56a6232676d25c8989f6b9035aae /llvm/test | |
| parent | 798ca1e6fe602018695d8cdf9942cf07c3bdd467 (diff) | |
| download | bcm5719-llvm-654ec2a663c91061966d773d5ac97e0a330e5729.tar.gz bcm5719-llvm-654ec2a663c91061966d773d5ac97e0a330e5729.zip | |
Fix an oops in x86 sibcall optimization. If the ByVal callee argument is itself passed as a pointer, then it's obviously not safe to do a tail call.
llvm-svn: 97797
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/CodeGen/X86/tailcall2.ll | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/tailcall2.ll b/llvm/test/CodeGen/X86/tailcall2.ll index 80bab619c16..90315fd2f26 100644 --- a/llvm/test/CodeGen/X86/tailcall2.ll +++ b/llvm/test/CodeGen/X86/tailcall2.ll @@ -195,3 +195,24 @@ bb2: } declare i32 @foo6(i32, i32, %struct.t* byval align 4) + +; rdar://r7717598 +%struct.ns = type { i32, i32 } +%struct.cp = type { float, float } + +define %struct.ns* @t13(%struct.cp* %yy) nounwind ssp { +; 32: t13: +; 32-NOT: jmp +; 32: call +; 32: ret + +; 64: t13: +; 64-NOT: jmp +; 64: call +; 64: ret +entry: + %0 = tail call fastcc %struct.ns* @foo7(%struct.cp* byval align 4 %yy, i8 signext 0) nounwind + ret %struct.ns* %0 +} + +declare fastcc %struct.ns* @foo7(%struct.cp* byval align 4, i8 signext) nounwind ssp |

