From f46262e0b7a183c22b9384cd729c5fb0f05e5d38 Mon Sep 17 00:00:00 2001 From: Manman Ren Date: Tue, 29 Mar 2016 17:37:21 +0000 Subject: Swift Calling Convention: add swiftself attribute. Differential Revision: http://reviews.llvm.org/D17866 llvm-svn: 264754 --- llvm/test/CodeGen/AArch64/swiftself.ll | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 llvm/test/CodeGen/AArch64/swiftself.ll (limited to 'llvm/test/CodeGen/AArch64/swiftself.ll') 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 +} -- cgit v1.2.3