summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/AArch64/swiftself.ll
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/CodeGen/AArch64/swiftself.ll')
-rw-r--r--llvm/test/CodeGen/AArch64/swiftself.ll29
1 files changed, 29 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/AArch64/swiftself.ll b/llvm/test/CodeGen/AArch64/swiftself.ll
new file mode 100644
index 00000000000..f93f8f39822
--- /dev/null
+++ b/llvm/test/CodeGen/AArch64/swiftself.ll
@@ -0,0 +1,29 @@
+; RUN: llc -verify-machineinstrs < %s -mtriple=aarch64-apple-ios | FileCheck --check-prefix=CHECK-APPLE %s
+; RUN: llc -O0 -verify-machineinstrs < %s -mtriple=aarch64-apple-ios | FileCheck --check-prefix=CHECK-O0 %s
+
+; Parameter with swiftself should be allocated to x9.
+define void @check_swiftself(i32* swiftself %addr0) {
+; CHECK-APPLE-LABEL: check_swiftself:
+; CHECK-O0-LABEL: check_swiftself:
+
+ %val0 = load volatile i32, i32* %addr0
+; CHECK-APPLE: ldr w{{.*}}, [x9]
+; CHECK-O0: ldr w{{.*}}, [x9]
+ ret void
+}
+
+@var8_3 = global i8 0
+declare void @take_swiftself(i8* swiftself %addr0)
+
+define void @simple_args() {
+; CHECK-APPLE-LABEL: simple_args:
+; CHECK-O0-LABEL: simple_args:
+
+ call void @take_swiftself(i8* @var8_3)
+; CHECK-APPLE: add x9,
+; CHECK-APPLE: bl {{_?}}take_swiftself
+; CHECK-O0: add x9,
+; CHECK-O0: bl {{_?}}take_swiftself
+
+ ret void
+}
OpenPOWER on IntegriCloud