|
3 | 3 | ; Make sure calls to the objc intrinsics are translated to calls in to the
|
4 | 4 | ; runtime
|
5 | 5 |
|
| 6 | +declare i8* @foo() |
| 7 | +declare i32 @__gxx_personality_v0(...) |
| 8 | + |
6 | 9 | define i8* @test_objc_autorelease(i8* %arg0) {
|
7 | 10 | ; CHECK-LABEL: test_objc_autorelease
|
8 | 11 | ; CHECK-NEXT: entry
|
@@ -153,6 +156,30 @@ entry:
|
153 | 156 | ret i8* %0
|
154 | 157 | }
|
155 | 158 |
|
| 159 | +define void @test_objc_retainAutoreleasedReturnValue_bundle() { |
| 160 | +; CHECK-LABEL: test_objc_retainAutoreleasedReturnValue_bundle( |
| 161 | +; CHECK-NEXT: call i8* @foo() [ "clang.arc.attachedcall"(i8* (i8*)* @objc_retainAutoreleasedReturnValue) ] |
| 162 | + call i8* @foo() [ "clang.arc.attachedcall"(i8* (i8*)* @llvm.objc.retainAutoreleasedReturnValue) ] |
| 163 | + ret void |
| 164 | +} |
| 165 | + |
| 166 | +define void @test_objc_retainAutoreleasedReturnValue_bundle_invoke() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { |
| 167 | +; CHECK-LABEL: test_objc_retainAutoreleasedReturnValue_bundle_invoke( |
| 168 | +; CHECK-NEXT: entry |
| 169 | +; CHECK-NEXT: invoke i8* @foo() [ "clang.arc.attachedcall"(i8* (i8*)* @objc_retainAutoreleasedReturnValue) ] |
| 170 | +entry: |
| 171 | + invoke i8* @foo() [ "clang.arc.attachedcall"(i8* (i8*)* @llvm.objc.retainAutoreleasedReturnValue) ] |
| 172 | + to label %invoke.cont unwind label %lpad |
| 173 | + |
| 174 | +invoke.cont: |
| 175 | + ret void |
| 176 | + |
| 177 | +lpad: |
| 178 | + %1 = landingpad { i8*, i32 } |
| 179 | + cleanup |
| 180 | + resume { i8*, i32 } %1 |
| 181 | +} |
| 182 | + |
156 | 183 | define i8* @test_objc_retainBlock(i8* %arg0) {
|
157 | 184 | ; CHECK-LABEL: test_objc_retainBlock
|
158 | 185 | ; CHECK-NEXT: entry
|
@@ -193,6 +220,13 @@ entry:
|
193 | 220 | ret i8* %0
|
194 | 221 | }
|
195 | 222 |
|
| 223 | +define void @test_objc_unsafeClaimAutoreleasedReturnValue_bundle() { |
| 224 | +; CHECK-LABEL: test_objc_unsafeClaimAutoreleasedReturnValue_bundle( |
| 225 | +; CHECK-NEXT: call i8* @foo() [ "clang.arc.attachedcall"(i8* (i8*)* @objc_unsafeClaimAutoreleasedReturnValue) ] |
| 226 | + call i8* @foo() [ "clang.arc.attachedcall"(i8* (i8*)* @llvm.objc.unsafeClaimAutoreleasedReturnValue) ] |
| 227 | + ret void |
| 228 | +} |
| 229 | + |
196 | 230 | define i8* @test_objc_retainedObject(i8* %arg0) {
|
197 | 231 | ; CHECK-LABEL: test_objc_retainedObject
|
198 | 232 | ; CHECK-NEXT: entry
|
|
0 commit comments