1 ; RUN: llc -mtriple aarch64-unknown-windows -swift-async-fp=never -filetype asm -o - %s | FileCheck %s
3 ; ModuleID = '_Concurrency.ll'
4 source_filename = "_Concurrency.ll"
5 target datalayout = "e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128"
6 target triple = "aarch64-unknown-windows-msvc19.32.31302"
8 %swift.context = type { ptr, ptr }
10 ; Function Attrs: argmemonly nofree nosync nounwind willreturn
11 declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0
13 ; Function Attrs: nounwind
14 define hidden swifttailcc void @"$ss23withCheckedContinuation8function_xSS_yScCyxs5NeverOGXEtYalFTQ0_"(ptr nocapture readonly %0) #1 {
16 %1 = load ptr, ptr %0, align 8
17 %2 = tail call ptr @llvm.swift.async.context.addr() #4
18 store ptr %1, ptr %2, align 8
19 %async.ctx.frameptr1 = getelementptr inbounds i8, ptr %1, i64 16
20 %.reload.addr4 = getelementptr inbounds i8, ptr %1, i64 24
21 %.reload5 = load ptr, ptr %.reload.addr4, align 8
22 %.reload = load ptr, ptr %async.ctx.frameptr1, align 8
23 %3 = load ptr, ptr %0, align 8
24 store ptr %3, ptr %2, align 8
25 tail call swiftcc void @swift_task_dealloc(ptr %.reload5) #4
26 tail call void @llvm.lifetime.end.p0(i64 -1, ptr %.reload5)
27 tail call swiftcc void @swift_task_dealloc(ptr %.reload) #4
28 %4 = getelementptr inbounds i8, ptr %3, i64 8
29 %5 = load ptr, ptr %4, align 8
30 musttail call swifttailcc void %5(ptr %3) #4
34 ; NOTE: we do not see the canonical windows frame setup due to the `nounwind`
35 ; attribtue on the function.
37 ; CHECK: sub sp, sp, #48
38 ; CHECK: stp x30, x29, [sp, #24]
39 ; CHECK: add x29, sp, #24
40 ; CHECK: str x19, [sp, #40]
41 ; CHECK: sub x8, x29, #8
45 ; Function Attrs: nounwind readnone
46 declare ptr @llvm.swift.async.context.addr() #2
48 ; Function Attrs: argmemonly nounwind
49 declare dllimport swiftcc void @swift_task_dealloc(ptr) local_unnamed_addr #3
51 attributes #0 = { argmemonly nofree nosync nounwind willreturn }
52 attributes #1 = { nounwind "frame-pointer"="none" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+neon" }
53 attributes #2 = { nounwind readnone }
54 attributes #3 = { argmemonly nounwind }
55 attributes #4 = { nounwind }