@@ -289,6 +289,85 @@ func testPrespecializedSinglePayloadEnumInt() {
289
289
290
290
testPrespecializedSinglePayloadEnumInt ( )
291
291
292
+ func testPrespecializedMultiPayloadEnumAnyObject( ) {
293
+ let ptr = UnsafeMutablePointer< PrespecializedMultiPayloadEnum< AnyObject>>. allocate( capacity: 1 )
294
+
295
+ do {
296
+ let x = PrespecializedMultiPayloadEnum< AnyObject> . nonEmpty0( 23 , SimpleClass ( x: 23 ) )
297
+ testInit ( ptr, to: x)
298
+ }
299
+
300
+ do {
301
+ let y = PrespecializedMultiPayloadEnum< AnyObject> . nonEmpty0( 32 , SimpleClass ( x: 32 ) )
302
+
303
+ // CHECK-NEXT: Before deinit
304
+ print ( " Before deinit " )
305
+
306
+ // CHECK-NEXT: SimpleClass deinitialized!
307
+ testAssign ( ptr, from: y)
308
+ }
309
+
310
+ // CHECK-NEXT: Before deinit
311
+ print ( " Before deinit " )
312
+
313
+
314
+ // CHECK-NEXT: SimpleClass deinitialized!
315
+ testDestroy ( ptr)
316
+
317
+ ptr. deallocate ( )
318
+ }
319
+
320
+ testPrespecializedMultiPayloadEnumAnyObject ( )
321
+
322
+ func testPrespecializedMultiPayloadEnumSimpleClass( ) {
323
+ let ptr = UnsafeMutablePointer< PrespecializedMultiPayloadEnum< SimpleClass>>. allocate( capacity: 1 )
324
+
325
+ do {
326
+ let x = PrespecializedMultiPayloadEnum< SimpleClass> . nonEmpty0( 23 , SimpleClass ( x: 23 ) )
327
+ testInit ( ptr, to: x)
328
+ }
329
+
330
+ do {
331
+ let y = PrespecializedMultiPayloadEnum< SimpleClass> . nonEmpty0( 32 , SimpleClass ( x: 32 ) )
332
+
333
+ // CHECK-NEXT: Before deinit
334
+ print ( " Before deinit " )
335
+
336
+ // CHECK-NEXT: SimpleClass deinitialized!
337
+ testAssign ( ptr, from: y)
338
+ }
339
+
340
+ // CHECK-NEXT: Before deinit
341
+ print ( " Before deinit " )
342
+
343
+
344
+ // CHECK-NEXT: SimpleClass deinitialized!
345
+ testDestroy ( ptr)
346
+
347
+ ptr. deallocate ( )
348
+ }
349
+
350
+ testPrespecializedMultiPayloadEnumSimpleClass ( )
351
+
352
+
353
+ func testPrespecializedMultiPayloadEnumInt( ) {
354
+ let ptr = UnsafeMutablePointer< PrespecializedMultiPayloadEnum< Int>>. allocate( capacity: 1 )
355
+
356
+ do {
357
+ let x = PrespecializedMultiPayloadEnum< Int> . nonEmpty0( 23 , 23 )
358
+ testInit ( ptr, to: x)
359
+ }
360
+
361
+ do {
362
+ let y = PrespecializedMultiPayloadEnum< Int> . nonEmpty0( 32 , 32 )
363
+ testAssign ( ptr, from: y)
364
+ }
365
+
366
+ ptr. deallocate ( )
367
+ }
368
+
369
+ testPrespecializedMultiPayloadEnumInt ( )
370
+
292
371
func testGenericTuple( ) {
293
372
let ptr = allocateInternalGenericPtr ( of: GenericTupleWrapper< TestClass> . self )
294
373
0 commit comments