1 ; RUN: llc -mtriple arm64-apple-ios -filetype asm -o - %s -swift-async-fp always | FileCheck %s -check-prefix CHECK-IOS-ALWAYS
2 ; RUN: llc -mtriple arm64-apple-ios -filetype asm -o - %s -swift-async-fp never | FileCheck %s -check-prefix CHECK-IOS-NEVER
3 ; RUN: llc -mtriple arm64-apple-ios -filetype asm -o - %s -swift-async-fp auto | FileCheck %s -check-prefix CHECK-IOS-AUTO
4 ; RUN: llc -mtriple arm64_32-apple-watchos -filetype asm -o - %s -swift-async-fp always | FileCheck %s -check-prefix CHECK-WATCHOS-ALWAYS
5 ; RUN: llc -mtriple arm64_32-apple-watchos -filetype asm -o - %s -swift-async-fp never | FileCheck %s -check-prefix CHECK-WATCHOS-NEVER
6 ; RUN: llc -mtriple arm64_32-apple-watchos -filetype asm -o - %s -swift-async-fp auto | FileCheck %s -check-prefix CHECK-WATCHOS-AUTO
8 declare ptr @llvm.swift.async.context.addr()
10 define swifttailcc void @f(ptr swiftasync %ctx) {
11 %1 = load ptr, ptr %ctx, align 8
12 %2 = tail call ptr @llvm.swift.async.context.addr()
13 store ptr %1, ptr %2, align 8
17 ; CHECK-IOS-NEVER: sub sp, sp, #32
18 ; CHECK-IOS-NEVER: stp x29, x30, [sp, #16]
20 ; CHECK-IOS-NEVER: ldp x29, x30, [sp, #16]
21 ; CHECK-IOS-NEVER: add sp, sp, #32
23 ; CHECK-IOS-ALWAYS: orr x29, x29, #0x1000000000000000
24 ; CHECK-IOS-ALWAYS: sub sp, sp, #32
25 ; CHECK-IOS-ALWAYS: stp x29, x30, [sp, #16]
27 ; CHECK-IOS-ALWAYS: ldp x29, x30, [sp, #16]
28 ; CHECK-IOS-ALWAYS: and x29, x29, #0xefffffffffffffff
29 ; CHECK-IOS-ALWAYS: add sp, sp, #32
31 ; CHECK-IOS-AUTO: adrp x16, _swift_async_extendedFramePointerFlags@GOTPAGE
32 ; CHECK-IOS-AUTO: ldr x16, [x16, _swift_async_extendedFramePointerFlags@GOTPAGEOFF]
33 ; CHECK-IOS-AUTO: orr x29, x29, x16
34 ; CHECK-IOS-AUTO: sub sp, sp, #32
35 ; CHECK-IOS-AUTO: stp x29, x30, [sp, #16]
37 ; CHECK-IOS-AUTO: ldp x29, x30, [sp, #16]
38 ; CHECK-IOS-AUTO: and x29, x29, #0xefffffffffffffff
39 ; CHECK-IOS-AUTO: add sp, sp, #32
41 ; CHECK-WATCHOS-NEVER: sub sp, sp, #32
42 ; CHECK-WATCHOS-NEVER: stp x29, x30, [sp, #16]
44 ; CHECK-WATCHOS-NEVER: ldp x29, x30, [sp, #16]
45 ; CHECK-WATCHOS-NEVER: add sp, sp, #32
47 ; CHECK-WATCHOS-ALWAYS: orr x29, x29, #0x1000000000000000
48 ; CHECK-WATCHOS-ALWAYS: sub sp, sp, #32
49 ; CHECK-WATCHOS-ALWAYS: stp x29, x30, [sp, #16]
51 ; CHECK-WATCHOS-ALWAYS: ldp x29, x30, [sp, #16]
52 ; CHECK-WATCHOS-ALWAYS: and x29, x29, #0xefffffffffffffff
53 ; CHECK-WATCHOS-ALWAYS: add sp, sp, #32
55 ; CHECK-WATCHOS-AUTO: adrp x16, _swift_async_extendedFramePointerFlags@GOTPAGE
56 ; CHECK-WATCHOS-AUTO: ldr w16, [x16, _swift_async_extendedFramePointerFlags@GOTPAGEOFF]
57 ; CHECK-WATCHOS-AUTO: orr x29, x29, x16, lsl #32
58 ; CHECK-WATCHOS-AUTO: sub sp, sp, #32
59 ; CHECK-WATCHOS-AUTO: stp x29, x30, [sp, #16]
61 ; CHECK-WATCHOS-AUTO: ldp x29, x30, [sp, #16]
62 ; CHECK-WATCHOS-AUTO: and x29, x29, #0xefffffffffffffff
63 ; CHECK-WATCHOS-AUTO: add sp, sp, #32