File tree Expand file tree Collapse file tree 3 files changed +26
-10
lines changed Expand file tree Collapse file tree 3 files changed +26
-10
lines changed Original file line number Diff line number Diff line change 11// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) %s -enable-objc-interop -emit-ir | %FileCheck -check-prefix CHECK -check-prefix CHECK-%target-ptrsize -check-prefix %target-cpu -DINT=i%target-ptrsize %s
22
3+ // REQUIRES: objc_codegen
4+
35// rdar://16565958
46
57import Builtin
Original file line number Diff line number Diff line change 11// RUN: %target-swift-frontend -module-name cf_objc_retainAutoreleasedReturnValue -I %S/Inputs %s -enable-objc-interop -emit-ir | %FileCheck %s
2- // RUN: %target-swift-frontend -module-name cf_objc_retainAutoreleasedReturnValue -I %S/Inputs %s -emit-ir | %FileCheck %s --check-prefix=NO_INTEROP
2+
3+ // We need to require objc_codegen to avoid this test on WASM.
4+ // (That's why the other half of this test is in a separate file.)
5+
6+ // REQUIRES: objc_codegen
37
48import CFBridgedType
59
@@ -10,15 +14,7 @@ public func foo() {
1014
1115// With interop enabled, this should use objc_retainAutoreleasedReturnValue()
1216
13- // CHECK-LABEL: define protected swiftcc void @"$s37cf_objc_retainAutoreleasedReturnValue3fooyyF"()
17+ // CHECK-LABEL: define {{.*}} swiftcc void @"$s37cf_objc_retainAutoreleasedReturnValue3fooyyF"()
1418// CHECK: entry:
1519// CHECK: %0 = call {{.*}}@returnsACFBridgedType()
1620// CHECK: %1 = notail call ptr @llvm.objc.retainAutoreleasedReturnValue(ptr %0)
17-
18- // Without interop, it should call swift_retain() instead.
19-
20- // NO_INTEROP-LABEL: define protected swiftcc void @"$s37cf_objc_retainAutoreleasedReturnValue3fooyyF"()
21- // NO_INTEROP: entry:
22- // NO_INTEROP: %0 = call {{.*}}@returnsACFBridgedType()
23- // NO_INTEROP: %1 = call ptr @swift_retain(ptr returned %0)
24-
Original file line number Diff line number Diff line change 1+ // RUN: %target-swift-frontend -module-name cf_objc_retainAutoreleasedReturnValue -I %S/Inputs %s -disable-objc-interop -emit-ir | %FileCheck %s
2+
3+ // This is in a separate file because *this* one works on WASM.
4+ // (cf_objc_retainAutoreleasedReturnValue.swift does not.)
5+
6+ import CFBridgedType
7+
8+ @inline ( never)
9+ public func foo( ) {
10+ let _ = returnsACFBridgedType ( )
11+ }
12+
13+ // With interop disabled, this should use swift_retain().
14+
15+ // CHECK-LABEL: define {{.*}}swiftcc void @"$s37cf_objc_retainAutoreleasedReturnValue3fooyyF"()
16+ // CHECK: entry:
17+ // CHECK: %0 = call {{.*}}@returnsACFBridgedType()
18+ // CHECK: %1 = call ptr @swift_retain(ptr returned %0)
You can’t perform that action at this time.
0 commit comments