@@ -156,3 +156,26 @@ extension P {
156
156
return tuple. value. foo ( )
157
157
}
158
158
}
159
+
160
+ // CHECK-LABEL: sil @$S6tuples15testTupleAssign1xySaySiGz_tF : $@convention(thin) (@inout Array<Int>) -> () {
161
+ // CHECK: [[ACCESS:%.*]] = begin_access [modify] [unknown] %0 : $*Array<Int>
162
+ // function_ref Array.subscript.nativeOwningMutableAddressor
163
+ // CHECK: [[ADDRESSOR:%.*]] = function_ref @$SSayxSiciao : $@convention(method) <τ_0_0> (Int, @inout Array<τ_0_0>) -> (UnsafeMutablePointer<τ_0_0>, @owned Builtin.NativeObject)
164
+ // CHECK: [[TUPLE:%.*]] = apply [[ADDRESSOR]]<Int>(%{{.*}}, [[ACCESS]]) : $@convention(method) <τ_0_0> (Int, @inout Array<τ_0_0>) -> (UnsafeMutablePointer<τ_0_0>, @owned Builtin.NativeObject)
165
+ // CHECK: ([[PTR:%.*]], [[OBJ:%.*]]) = destructure_tuple [[TUPLE]] : $(UnsafeMutablePointer<Int>, Builtin.NativeObject)
166
+ // CHECK: assign %{{.*}} to %{{.*}} : $*Int
167
+ // CHECK: end_access [[ACCESS]] : $*Array<Int>
168
+ // CHECK: destroy_value [[OBJ]] : $Builtin.NativeObject
169
+ //
170
+ // CHECK: [[ACCESS:%.*]] = begin_access [modify] [unknown] %0 : $*Array<Int>
171
+ // function_ref Array.subscript.nativeOwningMutableAddressor
172
+ // CHECK: [[ADDRESSOR:%.*]] = function_ref @$SSayxSiciao : $@convention(method) <τ_0_0> (Int, @inout Array<τ_0_0>) -> (UnsafeMutablePointer<τ_0_0>, @owned Builtin.NativeObject)
173
+ // CHECK: [[TUPLE:%.*]] = apply [[ADDRESSOR]]<Int>(%{{.*}}, [[ACCESS]]) : $@convention(method) <τ_0_0> (Int, @inout Array<τ_0_0>) -> (UnsafeMutablePointer<τ_0_0>, @owned Builtin.NativeObject)
174
+ // CHECK: ([[PTR:%.*]], [[OBJ:%.*]]) = destructure_tuple [[TUPLE]] : $(UnsafeMutablePointer<Int>, Builtin.NativeObject)
175
+ // CHECK: assign %{{.*}} to %{{.*}} : $*Int
176
+ // CHECK: end_access [[ACCESS]] : $*Array<Int>
177
+ // CHECK: destroy_value [[OBJ]] : $Builtin.NativeObject
178
+ // CHECK-LABEL: } // end sil function '$S6tuples15testTupleAssign1xySaySiGz_tF'
179
+ public func testTupleAssign( x: inout [ Int ] ) {
180
+ ( x [ 0 ] , x [ 1 ] ) = ( 0 , 1 )
181
+ }
0 commit comments