1 ; RUN: llc -mtriple x86_64-unknown-windows-msvc %s -o - | FileCheck %s -check-prefix CHECK64
2 ; RUN: llc -mtriple i686-windows-msvc %s -o - | FileCheck %s -check-prefix CHECK32
4 define void @simple(ptr swiftasync %context) "frame-pointer"="all" {
8 ; CHECK64-LABEL: simple:
9 ; CHECK64: btsq $60, %rbp
12 ; CHECK64: leaq 8(%rsp), %rbp
14 ; CHECK64: addq $16, %rsp
16 ; CHECK64: btrq $60, %rbp
19 ; CHECK32-LABEL: simple:
20 ; CHECK32: movl 8(%ebp), [[TMP:%.*]]
21 ; CHECK32: movl [[TMP]], {{.*}}(%ebp)
23 define void @more_csrs(ptr swiftasync %context) "frame-pointer"="all" {
24 call void asm sideeffect "", "~{r15}"()
28 ; CHECK64-LABEL: more_csrs:
29 ; CHECK64: btsq $60, %rbp
31 ; CHECK64: .seh_pushreg %rbp
33 ; CHECK64: .seh_pushreg %r14
34 ; CHECK64: leaq 8(%rsp), %rbp
35 ; CHECK64: subq $8, %rsp
37 ; CHECK64: .seh_pushreg %r15
40 ; CHECK64: addq $16, %rsp
42 ; CHECK64: btrq $60, %rbp
47 define void @locals(ptr swiftasync %context) "frame-pointer"="all" {
48 %var = alloca i32, i32 10
49 call void @f(ptr %var)
53 ; CHECK64-LABEL: locals:
54 ; CHECK64: btsq $60, %rbp
56 ; CHECK64: .seh_pushreg %rbp
58 ; CHECK64: .seh_pushreg %r14
59 ; CHECK64: leaq 8(%rsp), %rbp
60 ; CHECK64: subq $88, %rsp
62 ; CHECK64: leaq -48(%rbp), %rcx
65 ; CHECK64: addq $80, %rsp
66 ; CHECK64: addq $16, %rsp
68 ; CHECK64: btrq $60, %rbp
71 define void @use_input_context(ptr swiftasync %context, ptr %ptr) "frame-pointer"="all" {
72 store ptr %context, ptr %ptr
76 ; CHECK64-LABEL: use_input_context:
77 ; CHECK64: movq %r14, (%rcx)
79 declare ptr @llvm.swift.async.context.addr()
81 define ptr @context_in_func() "frmae-pointer"="non-leaf" {
82 %ptr = call ptr @llvm.swift.async.context.addr()
86 ; CHECK64-LABEL: context_in_func:
87 ; CHECK64: leaq -8(%rbp), %rax
89 ; CHECK32-LABEL: context_in_func:
90 ; CHECK32: movl %esp, %eax
92 define void @write_frame_context(ptr swiftasync %context, ptr %new_context) "frame-pointer"="non-leaf" {
93 %ptr = call ptr @llvm.swift.async.context.addr()
94 store ptr %new_context, ptr %ptr
98 ; CHECK64-LABEL: write_frame_context:
99 ; CHECK64: movq %rbp, [[TMP:%.*]]
100 ; CHECK64: subq $8, [[TMP]]
101 ; CHECK64: movq %rcx, ([[TMP]])
103 define void @simple_fp_elim(ptr swiftasync %context) "frame-pointer"="non-leaf" {
107 ; CHECK64-LABEL: simple_fp_elim: