|
16 | 16 |
|
17 | 17 | // CHECK: @"$s16class_resilience21ResilientGenericChildCMo" = {{(protected )?}}{{(dllexport )?}}global [[BOUNDS:{ (i32|i64), i32, i32 }]] zeroinitializer |
18 | 18 |
|
| 19 | +// CHECK: @"$s16class_resilience27ClassWithEmptyThenResilientC9resilient0H7_struct0G3IntVvpWvd" = hidden global [[INT]] 0, |
| 20 | +// CHECK: @"$s16class_resilience27ClassWithResilientThenEmptyC9resilient0H7_struct0E3IntVvpWvd" = hidden global [[INT]] 0, |
| 21 | + |
19 | 22 | // CHECK: @"$s16class_resilience26ClassWithResilientPropertyCMo" = {{(protected )?}}{{(dllexport )?}}constant [[BOUNDS]] |
20 | 23 | // CHECK-SAME-32: { [[INT]] 52, i32 2, i32 13 } |
21 | 24 | // CHECK-SAME-64: { [[INT]] 80, i32 2, i32 10 } |
|
113 | 116 | // CHECK-SAME-32: { [[INT]] 64, i32 2, i32 16 } |
114 | 117 | // CHECK-SAME-64: { [[INT]] 104, i32 2, i32 13 } |
115 | 118 |
|
| 119 | +// CHECK: @"$s16class_resilience27ClassWithEmptyThenResilientC5emptyAA0E0VvpWvd" = hidden constant [[INT]] 0, |
| 120 | +// CHECK: @"$s16class_resilience27ClassWithResilientThenEmptyC5emptyAA0G0VvpWvd" = hidden constant [[INT]] 0, |
| 121 | + |
116 | 122 | // CHECK: @"$s16class_resilience14ResilientChildC5fields5Int32VvgTq" = {{(protected )?}}{{(dllexport )?}}alias %swift.method_descriptor, getelementptr inbounds |
117 | 123 | // CHECK: @"$s16class_resilience14ResilientChildC5fields5Int32VvsTq" = {{(protected )?}}{{(dllexport )?}}alias %swift.method_descriptor, getelementptr inbounds |
118 | 124 | // CHECK: @"$s16class_resilience14ResilientChildC5fields5Int32VvMTq" = {{(protected )?}}{{(dllexport )?}}alias %swift.method_descriptor, getelementptr inbounds |
@@ -244,6 +250,34 @@ extension ResilientGenericOutsideParent { |
244 | 250 | } |
245 | 251 | } |
246 | 252 |
|
| 253 | +// rdar://48031465 |
| 254 | +// Field offsets for empty fields in resilient classes should be initialized |
| 255 | +// to their best-known value and made non-constant if that value might |
| 256 | +// disagree with the dynamic value. |
| 257 | + |
| 258 | +@_fixed_layout |
| 259 | +public struct Empty {} |
| 260 | + |
| 261 | +public class ClassWithEmptyThenResilient { |
| 262 | + public let empty: Empty |
| 263 | + public let resilient: ResilientInt |
| 264 | + |
| 265 | + public init(empty: Empty, resilient: ResilientInt) { |
| 266 | + self.empty = empty |
| 267 | + self.resilient = resilient |
| 268 | + } |
| 269 | +} |
| 270 | + |
| 271 | +public class ClassWithResilientThenEmpty { |
| 272 | + public let resilient: ResilientInt |
| 273 | + public let empty: Empty |
| 274 | + |
| 275 | + public init(empty: Empty, resilient: ResilientInt) { |
| 276 | + self.empty = empty |
| 277 | + self.resilient = resilient |
| 278 | + } |
| 279 | +} |
| 280 | + |
247 | 281 | // ClassWithResilientProperty.color getter |
248 | 282 |
|
249 | 283 | // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc i32 @"$s16class_resilience26ClassWithResilientPropertyC5colors5Int32Vvg"(%T16class_resilience26ClassWithResilientPropertyC* swiftself) |
|
0 commit comments