@@ -86,3 +86,33 @@ bb0(%0 : @owned $C):
8686 %9999 = tuple()
8787 return %9999 : $()
8888}
89+
90+ public struct GenWrapper<T> {
91+ @_hasStorage var _prop: T { get set }
92+ public var prop: T
93+ }
94+
95+ sil @borrow_addressonly_prop : $@convention(method) <τ_0_0> (@in_guaranteed GenWrapper<τ_0_0>) -> @guaranteed_address τ_0_0
96+ // CHECK: begin running test 1 of 2 on test_borrow_base: get_access_base with: %2
97+ // CHECK: sil [ossa] @test_borrow_base : $@convention(thin) <T> (@in_guaranteed GenWrapper<T>) -> @guaranteed_address T {
98+ // CHECK: bb0(%0 : $*GenWrapper<T>):
99+ // CHECK: %1 = function_ref @borrow_addressonly_prop : $@convention(method) <τ_0_0> (@in_guaranteed GenWrapper<τ_0_0>) -> @guaranteed_address τ_0_0
100+ // CHECK: %2 = apply %1<T>(%0) : $@convention(method) <τ_0_0> (@in_guaranteed GenWrapper<τ_0_0>) -> @guaranteed_address τ_0_0
101+ // CHECK: return %2
102+ // CHECK: }
103+ // CHECK: Address: %2 = apply %1<T>(%0) : $@convention(method) <τ_0_0> (@in_guaranteed GenWrapper<τ_0_0>) -> @guaranteed_address τ_0_0
104+ // CHECK: Base: %0 = argument of bb0 : $*GenWrapper<T>
105+ // CHECK: end running test 1 of 2 on test_borrow_base: get_access_base with: %2
106+ // CHECK: begin running test 2 of 2 on test_borrow_base: swift_get_access_base with: %2
107+ // CHECK: Address: %2 = apply %1<T>(%0) : $@convention(method) <τ_0_0> (@in_guaranteed GenWrapper<τ_0_0>) -> @guaranteed_address τ_0_0
108+ // CHECK: Base: argument - %0 = argument of bb0 : $*GenWrapper<T>
109+
110+ sil [ossa] @test_borrow_base : $@convention(thin) <T> (@in_guaranteed GenWrapper<T>) -> @guaranteed_address T {
111+ bb0(%0 : $*GenWrapper<T>):
112+ %1 = function_ref @borrow_addressonly_prop : $@convention(method) <τ_0_0> (@in_guaranteed GenWrapper<τ_0_0>) -> @guaranteed_address τ_0_0
113+ %2 = apply %1<T>(%0) : $@convention(method) <τ_0_0> (@in_guaranteed GenWrapper<τ_0_0>) -> @guaranteed_address τ_0_0
114+ specify_test "get_access_base %2"
115+ specify_test "swift_get_access_base %2"
116+ return %2
117+ }
118+
0 commit comments