@@ -27,6 +27,9 @@ public class C: Hashable {
2727 public func hash(into hasher: inout Hasher)
2828 public static func ==(_: C, _: C) -> Bool
2929}
30+ public class GC<T> {
31+ public final var x: T
32+ }
3033
3134public struct G<T> {
3235 public var x: T { get set }
@@ -299,6 +302,14 @@ sil_vtable C2 {}
299302// CHECK-32-SAME: i32 24 }>
300303// CHECK-64-SAME: i32 48 }>
301304
305+ // -- %gcx: GC<T>.x
306+ // CHECK: [[KP_GCX:@keypath(\..*)?]] = private global <{ {{.*}} }> <{
307+ // CHECK-SAME: @"generic environment l"
308+ // CHECK-SAME: @"symbolic 8keypaths2GCCyxG"
309+ // CHECK-SAME: @"symbolic x"
310+ // -- class with runtime-resolved offset, mutable
311+ // CHECK-SAME: <i32 0x3fffffe>
312+
302313// CHECK-LABEL: @"generic environment SHRzSHR_r0_l" = linkonce_odr hidden constant
303314// CHECK-SAME: i32 8193, i16 2, i8 -128, i8 -128, i32 128
304315
@@ -421,6 +432,14 @@ entry:
421432 return undef : $()
422433}
423434
435+ sil @generic_class_stored_final : $@convention(thin) <T> () -> () {
436+ entry:
437+ %gcx = keypath $ReferenceWritableKeyPath<GC<T>, T>, <T> (root $GC<T>; stored_property #GC.x: $T) <T>
438+
439+ return undef : $()
440+ }
441+
442+
424443// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @computed_property_generics
425444sil @computed_property_generics : $@convention(thin) <T, U> () -> () {
426445entry:
0 commit comments