summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/AArch64/swift-error.ll
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2017-09-22 04:31:44 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2017-09-22 04:31:44 +0000
commitba7a75c7b2d56c89d20500290b97565ecd44ea80 (patch)
tree261bf9caf4d7df1edd8e1711219567357e53daa5 /llvm/test/CodeGen/AArch64/swift-error.ll
parentc95d2c5dda635af5edfc7a6634605b99e3bcecd3 (diff)
downloadbcm5719-llvm-ba7a75c7b2d56c89d20500290b97565ecd44ea80.tar.gz
bcm5719-llvm-ba7a75c7b2d56c89d20500290b97565ecd44ea80.zip
AArch64: support SwiftCC properly on AAPCS64
The previous SwiftCC support for AAPCS64 was partially correct. It setup swiftself parameters in the proper register but failed to setup swifterror in the correct register. This would break compilation of swift code for non-Darwin AAPCS64 conforming environments. llvm-svn: 313956
Diffstat (limited to 'llvm/test/CodeGen/AArch64/swift-error.ll')
-rw-r--r--llvm/test/CodeGen/AArch64/swift-error.ll18
1 files changed, 18 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/AArch64/swift-error.ll b/llvm/test/CodeGen/AArch64/swift-error.ll
new file mode 100644
index 00000000000..79a31c19be1
--- /dev/null
+++ b/llvm/test/CodeGen/AArch64/swift-error.ll
@@ -0,0 +1,18 @@
+; RUN: llc -mtriple aarch64-unknown-linux-gnu -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*, i8*, i8*, i8*, i8*, %swift.error** swifterror %error) {
+entry:
+ call swiftcc void @f(%swift.error** nonnull nocapture swifterror %error)
+ ret void
+}
+
+; CHEECK-LABEL: g
+; CHECK: str x30, [sp, #-16]!
+; CHECK: bl f
+; CHECK: ldr x30, [sp], #16
+; CHECK: ret
+
OpenPOWER on IntegriCloud