1 ; RUN: llc -mtriple x86_64-unknown-windows-msvc %s -o - | FileCheck %s
3 declare swifttailcc void @callee()
5 define swifttailcc void @swift_tail() {
6 call void asm "","~{r14}"()
7 tail call swifttailcc void @callee()
11 ; CHECK-LABEL: swift_tail:
12 ; CHECK-NOT: popq %r14
14 define void @has_swift_async(ptr swiftasync %contet) {
15 call void asm "","~{r14}"()
19 ; CHECK-LABEL: has_swift_async:
22 ; It's impossible to get a tail call from a function without a swiftasync
23 ; parameter to one with unless the CC is swifttailcc. So it doesn't matter
24 ; whether r14 is callee-saved in this case.
25 define void @calls_swift_async() {
26 call void asm "","~{r14}"()
27 tail call void @has_swift_async(ptr swiftasync null)
31 ; CHECK-LABEL: calls_swift_async:
32 ; CHECK-NOT: jmpq has_swift_async
34 define swifttailcc void @no_preserve_swiftself() {
35 call void asm "","~{r13}"()
39 ; CHECK-LABEL: no_preserve_swiftself:
40 ; CHECK-NOT: popq %r13
42 declare swifttailcc ptr @swift_self(ptr swiftasync %context, ptr swiftself %self)
44 define swiftcc ptr @call_swift_self(ptr swiftself %self, ptr %context) {
45 ; call void asm "","~{r13}"()
46 ; We get a push r13 but why not with the call below?
47 %res = call swifttailcc ptr @swift_self(ptr swiftasync %context, ptr swiftself %self)
51 ; CHECK-LABEL: call_swift_self: