diff options
| author | Saleem Abdulrasool <compnerd@compnerd.org> | 2017-09-20 18:40:59 +0000 |
|---|---|---|
| committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2017-09-20 18:40:59 +0000 |
| commit | 432b88e5f45aa69f63d73a7e86a0b330d955e98c (patch) | |
| tree | 5747044089b068cca4b28f0e7c674a65cf1b5bad /llvm/test/CodeGen | |
| parent | c2189b8311affb1a8de08862767b597415010d96 (diff) | |
| download | bcm5719-llvm-432b88e5f45aa69f63d73a7e86a0b330d955e98c.tar.gz bcm5719-llvm-432b88e5f45aa69f63d73a7e86a0b330d955e98c.zip | |
CodeGen: support SwiftError SwiftCC on Windows x64
Add support for passing SwiftError through a register on the Windows x64
calling convention. This allows the use of swifterror attributes on
parameters which is used by the swift front end for the `Error`
parameter. This partially enables building the swift standard library
for Windows x86_64.
llvm-svn: 313791
Diffstat (limited to 'llvm/test/CodeGen')
| -rw-r--r-- | llvm/test/CodeGen/X86/swift-error.ll | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/swift-error.ll b/llvm/test/CodeGen/X86/swift-error.ll new file mode 100644 index 00000000000..5fb67d4f3b2 --- /dev/null +++ b/llvm/test/CodeGen/X86/swift-error.ll @@ -0,0 +1,18 @@ +; RUN: llc -mtriple x86_64-unknown-windows-msvc -filetype asm -o - %s | FileCheck %s + +%swift.error = type opaque + +declare swiftcc void @f(%swift.error** swifterror) + +define swiftcc void @g(i8*, i8*, i8*, i8*, %swift.error** swifterror %error) { +entry: + call swiftcc void @f(%swift.error** nonnull nocapture swifterror %error) + ret void +} + +; CHECK-LABEL: g +; CHECK: pushq %r12 +; CHECK: callq f +; CHECK: popq %r12 +; CHECK: retq + |

