@@ -210,6 +210,85 @@ func testPrespecializedSingletonEnumInt() {
210
210
211
211
testPrespecializedSingletonEnumInt ( )
212
212
213
+ func testPrespecializedSinglePayloadEnumAnyObject( ) {
214
+ let ptr = UnsafeMutablePointer< PrespecializedSinglePayloadEnum< AnyObject>>. allocate( capacity: 1 )
215
+
216
+ do {
217
+ let x = PrespecializedSinglePayloadEnum< AnyObject> . nonEmpty( 23 , SimpleClass ( x: 23 ) )
218
+ testInit ( ptr, to: x)
219
+ }
220
+
221
+ do {
222
+ let y = PrespecializedSinglePayloadEnum< AnyObject> . nonEmpty( 32 , SimpleClass ( x: 32 ) )
223
+
224
+ // CHECK-NEXT: Before deinit
225
+ print ( " Before deinit " )
226
+
227
+ // CHECK-NEXT: SimpleClass deinitialized!
228
+ testAssign ( ptr, from: y)
229
+ }
230
+
231
+ // CHECK-NEXT: Before deinit
232
+ print ( " Before deinit " )
233
+
234
+
235
+ // CHECK-NEXT: SimpleClass deinitialized!
236
+ testDestroy ( ptr)
237
+
238
+ ptr. deallocate ( )
239
+ }
240
+
241
+ testPrespecializedSinglePayloadEnumAnyObject ( )
242
+
243
+ func testPrespecializedSinglePayloadEnumSimpleClass( ) {
244
+ let ptr = UnsafeMutablePointer< PrespecializedSinglePayloadEnum< SimpleClass>>. allocate( capacity: 1 )
245
+
246
+ do {
247
+ let x = PrespecializedSinglePayloadEnum< SimpleClass> . nonEmpty( 23 , SimpleClass ( x: 23 ) )
248
+ testInit ( ptr, to: x)
249
+ }
250
+
251
+ do {
252
+ let y = PrespecializedSinglePayloadEnum< SimpleClass> . nonEmpty( 32 , SimpleClass ( x: 32 ) )
253
+
254
+ // CHECK-NEXT: Before deinit
255
+ print ( " Before deinit " )
256
+
257
+ // CHECK-NEXT: SimpleClass deinitialized!
258
+ testAssign ( ptr, from: y)
259
+ }
260
+
261
+ // CHECK-NEXT: Before deinit
262
+ print ( " Before deinit " )
263
+
264
+
265
+ // CHECK-NEXT: SimpleClass deinitialized!
266
+ testDestroy ( ptr)
267
+
268
+ ptr. deallocate ( )
269
+ }
270
+
271
+ testPrespecializedSinglePayloadEnumSimpleClass ( )
272
+
273
+
274
+ func testPrespecializedSinglePayloadEnumInt( ) {
275
+ let ptr = UnsafeMutablePointer< PrespecializedSinglePayloadEnum< Int>>. allocate( capacity: 1 )
276
+
277
+ do {
278
+ let x = PrespecializedSinglePayloadEnum< Int> . nonEmpty( 23 , 23 )
279
+ testInit ( ptr, to: x)
280
+ }
281
+
282
+ do {
283
+ let y = PrespecializedSinglePayloadEnum< Int> . nonEmpty( 32 , 32 )
284
+ testAssign ( ptr, from: y)
285
+ }
286
+
287
+ ptr. deallocate ( )
288
+ }
289
+
290
+ testPrespecializedSinglePayloadEnumInt ( )
291
+
213
292
func testGenericTuple( ) {
214
293
let ptr = allocateInternalGenericPtr ( of: GenericTupleWrapper< TestClass> . self )
215
294
0 commit comments