@@ -11,6 +11,7 @@ sil @takesOneInout : $@convention(thin) (@inout Int) -> ()
11
11
sil @makesInt : $@convention(thin) () -> Int
12
12
sil @takesInoutAndNoEscapeClosure : $@convention(thin) (@inout Int, @noescape @owned @callee_owned () -> ()) -> ()
13
13
sil @takesInoutAndNoEscapeClosureTakingArgument : $@convention(thin) (@inout Int, @noescape @owned @callee_owned (Int) -> ()) -> ()
14
+ sil @takesInoutAndNoEscapeGuaranteedClosureTakingArgument : $@convention(thin) (@inout Int, @noescape @guaranteed @callee_guaranteed (Int) -> ()) -> ()
14
15
sil @takesInoutAndNoEscapeClosureWithGenericReturn : $@convention(thin) <T> (@inout Int, @owned @noescape @callee_owned (Int) -> @out T) -> ()
15
16
sil @takesInoutAndNoEscapeBlockClosure : $@convention(thin) (@inout Int, @owned @convention(block) @noescape () -> ()) -> ()
16
17
sil @takesInoutAndNoEscapeOptionalBlockClosure : $@convention(thin) (@inout Int, @owned Optional<@convention(block) @noescape () -> ()>) -> ()
@@ -579,7 +580,7 @@ bb0(%0 : $Int):
579
580
580
581
sil hidden @closureWithArgument_1 : $@convention(thin) (Int, @inout_aliasable Int) -> () {
581
582
bb0(%0 : $Int, %1 : $*Int):
582
- %2 = begin_access [modify] [unknown] %1 : $*Int // expected-note {{conflicting access is here}}
583
+ %2 = begin_access [modify] [unknown] %1 : $*Int // expected-note 2 {{conflicting access is here}}
583
584
end_access %2 : $*Int
584
585
%3 = tuple ()
585
586
return %3 : $()
@@ -603,6 +604,26 @@ bb0(%0 : $Int):
603
604
return %9 : $()
604
605
}
605
606
607
+ // CHECK-LABEL: sil hidden @inProgressConflictWithNoEscapeGuaranteedClosureArgument : $@convention(thin) (Int) -> () {
608
+ sil hidden @inProgressConflictWithNoEscapeGuaranteedClosureArgument : $@convention(thin) (Int) -> () {
609
+ bb0(%0 : $Int):
610
+ %2 = alloc_box ${ var Int }
611
+ %3 = project_box %2 : ${ var Int }, 0
612
+ store %0 to [trivial] %3 : $*Int
613
+ %4 = function_ref @takesInoutAndNoEscapeGuaranteedClosureTakingArgument : $@convention(thin) (@inout Int, @noescape @guaranteed @callee_guaranteed (Int) -> ()) -> ()
614
+ %5 = function_ref @closureWithArgument_1 : $@convention(thin) (Int, @inout_aliasable Int) -> ()
615
+ %6 = partial_apply [callee_guaranteed] %5(%3) : $@convention(thin) (Int, @inout_aliasable Int) -> ()
616
+ %conv = convert_function %6 : $@callee_guaranteed (Int) -> () to $@callee_guaranteed @noescape (Int) -> ()
617
+ %bconv = begin_borrow %conv : $@callee_guaranteed @noescape (Int) -> ()
618
+ %7 = begin_access [modify] [unknown] %3 : $*Int // expected-error {{overlapping accesses, but modification requires exclusive access; consider copying to a local variable}}
619
+ %8 = apply %4(%3, %bconv) : $@convention(thin) (@inout Int, @noescape @guaranteed @callee_guaranteed (Int) -> ()) -> ()
620
+ end_access %7: $*Int
621
+ end_borrow %bconv from %conv : $@callee_guaranteed @noescape (Int) -> (), $@callee_guaranteed @noescape (Int) -> ()
622
+ destroy_value %2 : ${ var Int }
623
+ %9 = tuple ()
624
+ return %9 : $()
625
+ }
626
+
606
627
sil hidden @closureThatModifiesCapture_2 : $@convention(thin) (@inout_aliasable Int) -> () {
607
628
bb0(%0 : $*Int):
608
629
%1 = begin_access [modify] [unknown] %0 : $*Int // expected-error {{overlapping accesses, but modification requires exclusive access; consider copying to a local variable}}
0 commit comments