@@ -31,6 +31,11 @@ sil @getContainsKlass : $@convention(thin) () -> @owned ContainsKlass
31
31
sil @useIndirect : $@convention(thin) <T> (@in_guaranteed T) -> ()
32
32
sil @sideEffect : $@convention(thin) () -> ()
33
33
34
+ enum FakeOptional<T> {
35
+ case none
36
+ case some(T)
37
+ }
38
+
34
39
//===----------------------------------------------------------------------===//
35
40
// MARK: Tests
36
41
//===----------------------------------------------------------------------===//
@@ -391,17 +396,63 @@ bb0(%0 : @owned $Klass, %1 : @guaranteed $KlassWithKlassPair):
391
396
return %37 : $()
392
397
}
393
398
394
- // CHECK-LABEL: begin running test 1 of 1 on function_argument_inference_from_result : variable-name-inference with: @trace[0]
399
+ // CHECK-LABEL: begin running test 1 of 1 on function_argument_inference_through_structextract : variable-name-inference with: @trace[0]
395
400
// CHECK: Input Value: %3 = copy_value %2 : $Klass
396
401
// CHECK: Name: 'self.lhs'
397
402
// CHECK: Root: %0 = argument of bb0 : $KlassPair
398
- // CHECK: end running test 1 of 1 on function_argument_inference_from_result : variable-name-inference with: @trace[0]
399
- sil [ossa] @function_argument_inference_from_result : $@convention(thin) (@guaranteed KlassPair) -> @owned Klass {
403
+ // CHECK: end running test 1 of 1 on function_argument_inference_through_structextract : variable-name-inference with: @trace[0]
404
+ sil [ossa] @function_argument_inference_through_structextract : $@convention(thin) (@guaranteed KlassPair) -> @owned Klass {
400
405
bb0(%0 : @guaranteed $KlassPair):
401
406
specify_test "variable-name-inference @trace[0]"
402
407
debug_value %0 : $KlassPair, let, name "self", argno 1, implicit
403
408
%2 = struct_extract %0 : $KlassPair, #KlassPair.lhs
404
409
%3 = copy_value %2 : $Klass
405
410
debug_value [trace] %3 : $Klass
406
411
return %3 : $Klass
407
- }
412
+ }
413
+
414
+ // CHECK-LABEL: begin running test 1 of 1 on function_argument_inference_through_uncheckedenumdata: variable-name-inference with: @trace[0]
415
+ // CHECK: Input Value: %3 = copy_value %2 : $Klass
416
+ // CHECK: Name: 'self.some'
417
+ // CHECK: Root: %0 = argument of bb0 : $FakeOptional<Klass>
418
+ // CHECK: end running test 1 of 1 on function_argument_inference_through_uncheckedenumdata: variable-name-inference with: @trace[0]
419
+ sil [ossa] @function_argument_inference_through_uncheckedenumdata : $@convention(thin) (@guaranteed FakeOptional<Klass>) -> @owned Klass {
420
+ bb0(%0 : @guaranteed $FakeOptional<Klass>):
421
+ specify_test "variable-name-inference @trace[0]"
422
+ debug_value %0 : $FakeOptional<Klass>, let, name "self", argno 1, implicit
423
+ %2 = unchecked_enum_data %0 : $FakeOptional<Klass>, #FakeOptional.some!enumelt
424
+ %3 = copy_value %2 : $Klass
425
+ debug_value [trace] %3 : $Klass
426
+ return %3 : $Klass
427
+ }
428
+
429
+ // CHECK-LABEL: begin running test 1 of 1 on function_argument_inference_through_uncheckedtakeenumdataaddr: variable-name-inference with: @trace[0]
430
+ // CHECK: Input Value: %3 = load [take] %2 : $*Klass
431
+ // CHECK: Name: 'self.some'
432
+ // CHECK: Root: %0 = argument of bb0 : $*FakeOptional<Klass>
433
+ // CHECK: end running test 1 of 1 on function_argument_inference_through_uncheckedtakeenumdataaddr: variable-name-inference with: @trace[0]
434
+ sil [ossa] @function_argument_inference_through_uncheckedtakeenumdataaddr : $@convention(thin) (@in FakeOptional<Klass>) -> @owned Klass {
435
+ bb0(%0 : $*FakeOptional<Klass>):
436
+ specify_test "variable-name-inference @trace[0]"
437
+ debug_value %0 : $*FakeOptional<Klass>, let, name "self", argno 1, implicit
438
+ %2 = unchecked_take_enum_data_addr %0 : $*FakeOptional<Klass>, #FakeOptional.some!enumelt
439
+ %3 = load [take] %2 : $*Klass
440
+ debug_value [trace] %3 : $Klass
441
+ return %3 : $Klass
442
+ }
443
+
444
+ // CHECK-LABEL: begin running test 1 of 1 on function_argument_inference_through_uncheckedtakeenumdataaddr_2: variable-name-inference with: @trace[0]
445
+ // CHECK: Input Value: %2 = unchecked_take_enum_data_addr %0
446
+ // CHECK: Name: 'self.some'
447
+ // CHECK: Root: %0 = argument of bb0 : $*FakeOptional<Klass>
448
+ // CHECK: end running test 1 of 1 on function_argument_inference_through_uncheckedtakeenumdataaddr_2: variable-name-inference with: @trace[0]
449
+ sil [ossa] @function_argument_inference_through_uncheckedtakeenumdataaddr_2 : $@convention(thin) (@in FakeOptional<Klass>) -> @owned Klass {
450
+ bb0(%0 : $*FakeOptional<Klass>):
451
+ specify_test "variable-name-inference @trace[0]"
452
+ debug_value %0 : $*FakeOptional<Klass>, let, name "self", argno 1, implicit
453
+ %2 = unchecked_take_enum_data_addr %0 : $*FakeOptional<Klass>, #FakeOptional.some!enumelt
454
+ debug_value [trace] %2 : $*Klass
455
+ %3 = load [take] %2 : $*Klass
456
+ return %3 : $Klass
457
+ }
458
+
0 commit comments