88// unnecessary.
99// ONONE-NOT: @__swift_fixLifetime
1010
11- // CHECK-objc-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @test(%T11fixlifetime1CC* %0, %objc_object* %1, i8** %2, i8* %3, %swift.refcounted* %4, %T11fixlifetime3AggV* noalias nocapture dereferenceable({{.*}}) %5) {{.*}} {
11+ // CHECK-objc-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @test(%T11fixlifetime1CC* %0, %objc_object* %1, i8** %2, i8* %3, %swift.refcounted* %4, %T11fixlifetime3AggV* noalias nocapture dereferenceable({{.*}}) %5, i64 %6, i64 %7 ) {{.*}} {
1212// CHECK-objc: entry:
1313// CHECK-objc: call void bitcast (void (%swift.refcounted*)* @__swift_fixLifetime to void (%T11fixlifetime1CC*)*)(%T11fixlifetime1CC*
1414// CHECK-objc: call void bitcast (void (%swift.refcounted*)* @__swift_fixLifetime to void (%objc_object*)*)(%objc_object*
1515// CHECK-objc: call void @__swift_fixLifetime(%swift.refcounted*
1616// CHECK-objc: call void bitcast (void (%swift.refcounted*)* @__swift_fixLifetime to void (%T11fixlifetime1CC*)*)(%T11fixlifetime1CC*
1717// CHECK-objc: call void bitcast (void (%swift.refcounted*)* @__swift_fixLifetime to void (%objc_object*)*)(%objc_object*
1818// CHECK-objc: call void @__swift_fixLifetime(%swift.refcounted*
19+ // CHECK-objc: [[TEMP:%.*]] = inttoptr i64 %6 to %objc_object*
20+ // CHECK-objc: call void bitcast (void (%swift.refcounted*)* @__swift_fixLifetime to void (%objc_object*)*)(%objc_object* [[TEMP]])
1921// CHECK-objc: call void bitcast (void (%swift.refcounted*)* @__swift_fixLifetime to void (%T11fixlifetime1CC**)*)(%T11fixlifetime1CC**
2022
21- // CHECK-native-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @test(%T11fixlifetime1CC* %0, %swift.refcounted* %1, i8** %2, i8* %3, %swift.refcounted* %4, %T11fixlifetime3AggV* noalias nocapture dereferenceable({{.*}}) %5) {{.*}} {
23+ // CHECK-native-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @test(%T11fixlifetime1CC* %0, %swift.refcounted* %1, i8** %2, i8* %3, %swift.refcounted* %4, %T11fixlifetime3AggV* noalias nocapture dereferenceable({{.*}}) %5, i64 %6, i64 %7 ) {{.*}} {
2224// CHECK-native: entry:
2325// CHECK-native: call void bitcast (void (%swift.refcounted*)* @__swift_fixLifetime to void (%T11fixlifetime1CC*)*)(%T11fixlifetime1CC*
2426// CHECK-native: call void @__swift_fixLifetime(%swift.refcounted*
@@ -44,17 +46,23 @@ struct Agg {
4446 var f : F
4547}
4648
49+ enum MyOptional<T> {
50+ case none
51+ case some(T)
52+ }
53+
4754sil [Onone] @test
48- : $@convention(thin) (C, P, @callee_owned () -> (), Agg) -> () {
49- bb0(%0 : $C, %1 : $P, %2 : $@callee_owned () -> (), %3 : $Agg):
55+ : $@convention(thin) (C, P, @callee_owned () -> (), Agg, @guaranteed MyOptional<P> ) -> () {
56+ bb0(%0 : $C, %1 : $P, %2 : $@callee_owned () -> (), %3 : $Agg, %4 : $MyOptional<P> ):
5057 fix_lifetime %0 : $C
5158 fix_lifetime %1 : $P
5259 fix_lifetime %2 : $@callee_owned () -> ()
5360 fix_lifetime %3 : $Agg
61+ fix_lifetime %4 : $MyOptional<P>
5462
55- %4 = alloc_stack $C
56- fix_lifetime %4 : $*C
57- dealloc_stack %4 : $*C
63+ %5 = alloc_stack $C
64+ fix_lifetime %5 : $*C
65+ dealloc_stack %5 : $*C
5866 %9999 = tuple()
5967 return %9999 : $()
6068}
0 commit comments