8
8
// unnecessary.
9
9
// ONONE-NOT: @__swift_fixLifetime
10
10
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|i32)}} %6, {{(i64|i32)}} %7 ) {{.*}} {
12
12
// CHECK-objc: entry:
13
13
// CHECK-objc: call void bitcast (void (%swift.refcounted*)* @__swift_fixLifetime to void (%T11fixlifetime1CC*)*)(%T11fixlifetime1CC*
14
14
// CHECK-objc: call void bitcast (void (%swift.refcounted*)* @__swift_fixLifetime to void (%objc_object*)*)(%objc_object*
15
15
// CHECK-objc: call void @__swift_fixLifetime(%swift.refcounted*
16
16
// CHECK-objc: call void bitcast (void (%swift.refcounted*)* @__swift_fixLifetime to void (%T11fixlifetime1CC*)*)(%T11fixlifetime1CC*
17
17
// CHECK-objc: call void bitcast (void (%swift.refcounted*)* @__swift_fixLifetime to void (%objc_object*)*)(%objc_object*
18
18
// CHECK-objc: call void @__swift_fixLifetime(%swift.refcounted*
19
+ // CHECK-objc: [[TEMP:%.*]] = inttoptr {{(i64|i32)}} %6 to %objc_object*
20
+ // CHECK-objc: call void bitcast (void (%swift.refcounted*)* @__swift_fixLifetime to void (%objc_object*)*)(%objc_object* [[TEMP]])
19
21
// CHECK-objc: call void bitcast (void (%swift.refcounted*)* @__swift_fixLifetime to void (%T11fixlifetime1CC**)*)(%T11fixlifetime1CC**
20
22
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|i32)}} %6, {{(i64|i32)}} %7 ) {{.*}} {
22
24
// CHECK-native: entry:
23
25
// CHECK-native: call void bitcast (void (%swift.refcounted*)* @__swift_fixLifetime to void (%T11fixlifetime1CC*)*)(%T11fixlifetime1CC*
24
26
// CHECK-native: call void @__swift_fixLifetime(%swift.refcounted*
@@ -44,17 +46,23 @@ struct Agg {
44
46
var f : F
45
47
}
46
48
49
+ enum MyOptional<T> {
50
+ case none
51
+ case some(T)
52
+ }
53
+
47
54
sil [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> ):
50
57
fix_lifetime %0 : $C
51
58
fix_lifetime %1 : $P
52
59
fix_lifetime %2 : $@callee_owned () -> ()
53
60
fix_lifetime %3 : $Agg
61
+ fix_lifetime %4 : $MyOptional<P>
54
62
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
58
66
%9999 = tuple()
59
67
return %9999 : $()
60
68
}
0 commit comments