diff options
author | Arnold Schwaighofer <aschwaighofer@apple.com> | 2017-02-13 19:58:28 +0000 |
---|---|---|
committer | Arnold Schwaighofer <aschwaighofer@apple.com> | 2017-02-13 19:58:28 +0000 |
commit | 8f3df731dc3db361e99d5ef2b86b760b511e70dc (patch) | |
tree | 1a7e456d0d550df00a155329c2f323e882284f2e /llvm/test/CodeGen/ARM/swifterror.ll | |
parent | 2b33f65317aa8f4145432f902c12d5a127bcbffe (diff) | |
download | bcm5719-llvm-8f3df731dc3db361e99d5ef2b86b760b511e70dc.tar.gz bcm5719-llvm-8f3df731dc3db361e99d5ef2b86b760b511e70dc.zip |
swiftcc: Don't emit tail calls from callers with swifterror parameters
Backends don't support this yet. They would have to move to the swifterror
register before the tail call to make sure it is live-in to the call.
rdar://30495920
llvm-svn: 294982
Diffstat (limited to 'llvm/test/CodeGen/ARM/swifterror.ll')
-rw-r--r-- | llvm/test/CodeGen/ARM/swifterror.ll | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/ARM/swifterror.ll b/llvm/test/CodeGen/ARM/swifterror.ll index 45a864d1af1..78764202f62 100644 --- a/llvm/test/CodeGen/ARM/swifterror.ll +++ b/llvm/test/CodeGen/ARM/swifterror.ll @@ -513,3 +513,18 @@ define swiftcc { i32, i32, i32, i32} @params_and_return_in_reg(i32, i32, i32, i3 } declare swiftcc { i32, i32, i32, i32 } @params_and_return_in_reg2(i32, i32, i32, i32, i8* swiftself, %swift_error** nocapture swifterror %err) + + +declare void @acallee(i8*) + +; Make sure we don't tail call if the caller returns a swifterror value. We +; would have to move into the swifterror register before the tail call. +; CHECK-APPLE: tailcall_from_swifterror: +; CHECK-APPLE-NOT: b _acallee +; CHECK-APPLE: bl _acallee + +define swiftcc void @tailcall_from_swifterror(%swift_error** swifterror %error_ptr_ref) { +entry: + tail call void @acallee(i8* null) + ret void +} |