|
1 |
| -// RUN: %target-swift-emit-silgen -module-name inlinable_attribute -emit-verbose-sil -warnings-as-errors %s | %FileCheck %s |
| 1 | +// RUN: %target-swift-emit-silgen -module-name inlinable_attribute -emit-verbose-sil -warnings-as-errors -disable-availability-checking %s | %FileCheck %s |
2 | 2 |
|
3 | 3 | // CHECK-LABEL: sil [serialized] [ossa] @$s19inlinable_attribute15fragileFunctionyyF : $@convention(thin) () -> ()
|
4 | 4 | @inlinable public func fragileFunction() {
|
@@ -37,6 +37,32 @@ public class MyCls {
|
37 | 37 | }
|
38 | 38 | }
|
39 | 39 |
|
| 40 | +public actor MyAct { |
| 41 | + // CHECK-LABEL: sil [serialized] [ossa] @$s19inlinable_attribute5MyActCfD : $@convention(method) (@owned MyAct) -> () |
| 42 | + @inlinable deinit {} |
| 43 | + |
| 44 | + /// whether delegating or not, the initializers for an actor are not serialized unless marked inlinable. |
| 45 | + |
| 46 | + // CHECK-LABEL: sil [exact_self_class] [ossa] @$s19inlinable_attribute5MyActC14designatedInitACyt_tcfC : $@convention(method) (@thick MyAct.Type) -> @owned MyAct |
| 47 | + // CHECK-LABEL: sil [ossa] @$s19inlinable_attribute5MyActC14designatedInitACyt_tcfc : $@convention(method) (@owned MyAct) -> @owned MyAct |
| 48 | + public init(designatedInit: ()) {} |
| 49 | + |
| 50 | + // CHECK-LABEL: sil [ossa] @$s19inlinable_attribute5MyActC15convenienceInitACyt_tcfC : $@convention(method) (@thick MyAct.Type) -> @owned MyAct |
| 51 | + public init(convenienceInit: ()) { |
| 52 | + self.init(designatedInit: ()) |
| 53 | + } |
| 54 | + |
| 55 | + |
| 56 | + // CHECK-LABEL: sil [serialized] [exact_self_class] [ossa] @$s19inlinable_attribute5MyActC0A14DesignatedInitACyt_tcfC : $@convention(method) (@thick MyAct.Type) -> @owned MyAct |
| 57 | + // CHECK-LABEL: sil [serialized] [ossa] @$s19inlinable_attribute5MyActC0A14DesignatedInitACyt_tcfc : $@convention(method) (@owned MyAct) -> @owned MyAct |
| 58 | + @inlinable public init(inlinableDesignatedInit: ()) {} |
| 59 | + |
| 60 | + // CHECK-LABEL: sil [serialized] [ossa] @$s19inlinable_attribute5MyActC0A15ConvenienceInitACyt_tcfC : $@convention(method) (@thick MyAct.Type) -> @owned MyAct |
| 61 | + @inlinable public init(inlinableConvenienceInit: ()) { |
| 62 | + self.init(designatedInit: ()) |
| 63 | + } |
| 64 | +} |
| 65 | + |
40 | 66 | // Make sure enum case constructors for public and versioned enums are
|
41 | 67 | // [serialized].
|
42 | 68 | @usableFromInline enum MyEnum {
|
|
0 commit comments