diff options
author | Arnold Schwaighofer <aschwaighofer@apple.com> | 2016-09-21 16:53:36 +0000 |
---|---|---|
committer | Arnold Schwaighofer <aschwaighofer@apple.com> | 2016-09-21 16:53:36 +0000 |
commit | de2490d0dcff0dd4358456d94f88bdf99859fb5c (patch) | |
tree | 18fcc282a44fb6a3bd01c8b6003322ac305935e9 /llvm/test/CodeGen | |
parent | 15869f86d84927ceb965eb5eaecabf523d8c7eb9 (diff) | |
download | bcm5719-llvm-de2490d0dcff0dd4358456d94f88bdf99859fb5c.tar.gz bcm5719-llvm-de2490d0dcff0dd4358456d94f88bdf99859fb5c.zip |
Disable tail calls if there is an swifterror argument
ISel does not handle them correctly yet i.e we crash trying to emit tail call
code.
radar://28407842
llvm-svn: 282088
Diffstat (limited to 'llvm/test/CodeGen')
-rw-r--r-- | llvm/test/CodeGen/AArch64/swifterror.ll | 12 | ||||
-rw-r--r-- | llvm/test/CodeGen/ARM/swifterror.ll | 12 | ||||
-rw-r--r-- | llvm/test/CodeGen/X86/swifterror.ll | 12 |
3 files changed, 36 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/AArch64/swifterror.ll b/llvm/test/CodeGen/AArch64/swifterror.ll index a0bfffdef95..507ae4d37d5 100644 --- a/llvm/test/CodeGen/AArch64/swifterror.ll +++ b/llvm/test/CodeGen/AArch64/swifterror.ll @@ -383,3 +383,15 @@ handler: call void @free(i8* %tmp) ret float 1.0 } + +; Check that we don't blow up on tail calling swifterror argument functions. +define float @tailcallswifterror(%swift_error** swifterror %error_ptr_ref) { +entry: + %0 = tail call float @tailcallswifterror(%swift_error** swifterror %error_ptr_ref) + ret float %0 +} +define swiftcc float @tailcallswifterror_swiftcc(%swift_error** swifterror %error_ptr_ref) { +entry: + %0 = tail call swiftcc float @tailcallswifterror_swiftcc(%swift_error** swifterror %error_ptr_ref) + ret float %0 +} diff --git a/llvm/test/CodeGen/ARM/swifterror.ll b/llvm/test/CodeGen/ARM/swifterror.ll index 17bd7059f6d..29cd2ffc281 100644 --- a/llvm/test/CodeGen/ARM/swifterror.ll +++ b/llvm/test/CodeGen/ARM/swifterror.ll @@ -379,3 +379,15 @@ handler: call void @free(i8* %tmp) ret float 1.0 } + +; Check that we don't blow up on tail calling swifterror argument functions. +define float @tailcallswifterror(%swift_error** swifterror %error_ptr_ref) { +entry: + %0 = tail call float @tailcallswifterror(%swift_error** swifterror %error_ptr_ref) + ret float %0 +} +define swiftcc float @tailcallswifterror_swiftcc(%swift_error** swifterror %error_ptr_ref) { +entry: + %0 = tail call swiftcc float @tailcallswifterror_swiftcc(%swift_error** swifterror %error_ptr_ref) + ret float %0 +} diff --git a/llvm/test/CodeGen/X86/swifterror.ll b/llvm/test/CodeGen/X86/swifterror.ll index b1e82e54328..b7226eb2b4e 100644 --- a/llvm/test/CodeGen/X86/swifterror.ll +++ b/llvm/test/CodeGen/X86/swifterror.ll @@ -466,3 +466,15 @@ gen_error: normal: ret float 0.0 } + +; Check that we don't blow up on tail calling swifterror argument functions. +define float @tailcallswifterror(%swift_error** swifterror %error_ptr_ref) { +entry: + %0 = tail call float @tailcallswifterror(%swift_error** swifterror %error_ptr_ref) + ret float %0 +} +define swiftcc float @tailcallswifterror_swiftcc(%swift_error** swifterror %error_ptr_ref) { +entry: + %0 = tail call swiftcc float @tailcallswifterror_swiftcc(%swift_error** swifterror %error_ptr_ref) + ret float %0 +} |