1 # RUN: llc -o - -run-pass=x86-pseudo -verify-machineinstrs %s | FileCheck %s
4 target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
5 target triple = "x86_64-apple-macosx11.0.0"
7 declare ptr @objc_retainAutoreleasedReturnValue(ptr)
8 declare ptr @objc_unsafeClaimAutoreleasedReturnValue(ptr)
11 define void @test_objc_retainAutoreleaseReturnedValue() {
15 define void @test_objc_unsafeClaimAutoreleasedReturnValue() {
19 define void @test_objc_unsafeClaimAutoreleasedReturnValue_2_args() {
23 define void @test_ret_void() {
29 # CHECK-LABEL: name: test_objc_retainAutoreleaseReturnedValue
31 # CHECK-NEXT: frame-setup PUSH64r undef $rax, implicit-def $rsp, implicit $rsp
32 # CHECK-NEXT: CFI_INSTRUCTION def_cfa_offset 16
34 # CHECK-NEXT: CALL64pcrel32 @fn, csr_64, implicit $rsp, implicit $ssp, implicit $rsp, implicit $ssp, implicit-def $rsp, implicit-def $ssp, implicit-def $rax
35 # CHECK-NEXT: $rdi = MOV64rr internal $rax
36 # CHECK-NEXT: CALL64pcrel32 @objc_retainAutoreleasedReturnValue, csr_64, implicit internal $rsp, implicit internal $ssp, implicit-def $rax
38 # CHECK-NEXT: $rcx = frame-destroy POP64r implicit-def $rsp, implicit $rsp
42 name: test_objc_retainAutoreleaseReturnedValue
44 tracksRegLiveness: true
52 machineFunctionInfo: {}
55 frame-setup PUSH64r undef $rax, implicit-def $rsp, implicit $rsp
56 CFI_INSTRUCTION def_cfa_offset 16
57 CALL64pcrel32_RVMARKER @objc_retainAutoreleasedReturnValue, @fn, csr_64, implicit $rsp, implicit $ssp, implicit-def $rsp, implicit-def $ssp, implicit-def $rax
58 $rcx = frame-destroy POP64r implicit-def $rsp, implicit $rsp
63 # CHECK-LABEL: name: test_objc_unsafeClaimAutoreleasedReturnValue
65 # CHECK-NEXT: frame-setup PUSH64r undef $rax, implicit-def $rsp, implicit $rsp
66 # CHECK-NEXT: CFI_INSTRUCTION def_cfa_offset 16
68 # CHECK-NEXT: CALL64pcrel32 @fn, csr_64, implicit $rsp, implicit $ssp, implicit $rsp, implicit $ssp, implicit-def $rsp, implicit-def $ssp, implicit-def $rax
69 # CHECK-NEXT: $rdi = MOV64rr internal $rax
70 # CHECK-NEXT: CALL64pcrel32 @objc_unsafeClaimAutoreleasedReturnValue, csr_64, implicit internal $rsp, implicit internal $ssp, implicit-def $rax
72 # CHECK-NEXT: $rcx = frame-destroy POP64r implicit-def $rsp, implicit $rsp
75 name: test_objc_unsafeClaimAutoreleasedReturnValue
77 tracksRegLiveness: true
85 machineFunctionInfo: {}
88 frame-setup PUSH64r undef $rax, implicit-def $rsp, implicit $rsp
89 CFI_INSTRUCTION def_cfa_offset 16
90 CALL64pcrel32_RVMARKER @objc_unsafeClaimAutoreleasedReturnValue, @fn, csr_64, implicit $rsp, implicit $ssp, implicit-def $rsp, implicit-def $ssp, implicit-def $rax
91 $rcx = frame-destroy POP64r implicit-def $rsp, implicit $rsp
96 # CHECK-LABEL: name: test_objc_unsafeClaimAutoreleasedReturnValue_2_args
98 # CHECK: frame-setup PUSH64r undef $rax, implicit-def $rsp, implicit $rsp
99 # CHECK-NEXT: $rax = MOV64rr $rdi
100 # CHECK-NEXT: $rdi = MOV64rr killed $rdx
101 # CHECK-NEXT: $rdx = MOV64rr killed $rax
103 # CHECK-NEXT: CALL64pcrel32 @fn, csr_64, implicit $rsp, implicit $ssp, implicit $rsp, implicit $ssp, implicit $rdi, implicit $rsi, implicit $rdx, implicit-def $rsp, implicit-def $ssp, implicit-def $rax
104 # CHECK-NEXT: $rdi = MOV64rr internal $rax
105 # CHECK-NEXT: CALL64pcrel32 @objc_retainAutoreleasedReturnValue, csr_64, implicit internal $rsp, implicit internal $ssp, implicit-def dead $rax
107 # CHECK-NEXT: $rax = frame-destroy POP64r implicit-def $rsp, implicit $rsp
110 name: test_objc_unsafeClaimAutoreleasedReturnValue_2_args
112 tracksRegLiveness: true
120 machineFunctionInfo: {}
123 liveins: $rdi, $rdx, $rsi
125 frame-setup PUSH64r undef $rax, implicit-def $rsp, implicit $rsp
127 $rdi = MOV64rr killed $rdx
128 $rdx = MOV64rr killed $rax
129 CALL64pcrel32_RVMARKER @objc_retainAutoreleasedReturnValue, @fn, csr_64, implicit $rsp, implicit $ssp, implicit $rdi, implicit $rsi, implicit $rdx, implicit-def $rsp, implicit-def $ssp, implicit-def dead $rax
130 $rax = frame-destroy POP64r implicit-def $rsp, implicit $rsp
134 # CHECK-LABEL: name: test_ret_void
136 # CHECK-NEXT: frame-setup PUSH64r undef $rax, implicit-def $rsp, implicit $rsp
137 # CHECK-NEXT: CFI_INSTRUCTION def_cfa_offset 16
139 # CHECK-NEXT: CALL64pcrel32 @fn, csr_64, implicit $rsp, implicit $ssp, implicit $rsp, implicit $ssp, implicit-def $rsp, implicit-def $ssp, implicit-def $rax
140 # CHECK-NEXT: $rdi = MOV64rr internal $rax
141 # CHECK-NEXT: CALL64pcrel32 @objc_retainAutoreleasedReturnValue, csr_64, implicit internal $rsp, implicit internal $ssp, implicit-def dead $rax
143 # CHECK-NEXT: $rax = frame-destroy POP64r implicit-def $rsp, implicit $rsp
148 tracksRegLiveness: true
156 machineFunctionInfo: {}
159 frame-setup PUSH64r undef $rax, implicit-def $rsp, implicit $rsp
160 CFI_INSTRUCTION def_cfa_offset 16
161 CALL64pcrel32_RVMARKER @objc_retainAutoreleasedReturnValue, @fn, csr_64, implicit $rsp, implicit $ssp, implicit-def $rsp, implicit-def $ssp, implicit-def dead $rax
162 $rax = frame-destroy POP64r implicit-def $rsp, implicit $rsp