@@ -1915,7 +1915,7 @@ bb0(%0 : $*SomeData):
19151915
19161916// CHECK-LABEL: CG of testAccessMarker
19171917// CHECK-NEXT: Arg %0 Esc: A, Succ: (%0.1)
1918- // CHECK-NEXT: Con [ref] %0.1 Esc: G , Succ:
1918+ // CHECK-NEXT: Con [ref] %0.1 Esc: A , Succ:
19191919// CHECK-LABEL: End
19201920sil hidden @testAccessMarker : $@convention(thin) (@inout SomeData) -> () {
19211921bb0(%0 : $*SomeData):
@@ -1927,6 +1927,34 @@ bb0(%0 : $*SomeData):
19271927 return %5 : $()
19281928}
19291929
1930+ // Test that end_access does not cause its storage to escape.
1931+ //
1932+ // CHECK-LABEL: CG of testEndAccess
1933+ // CHECK: Val [ref] %0 Esc: , Succ: (%3)
1934+ // CHECK: Con [int] %3 Esc: , Succ: (%3.1)
1935+ // CHECK: Con [ref] %3.1 Esc: , Succ:
1936+ // CHECK: End
1937+ // CHECK: NoEscape: %0 = alloc_ref $IntWrapper
1938+ // CHECK: to set_deallocating %0 : $IntWrapper
1939+ // CHECK: NoEscape: %3 = ref_element_addr %0 : $IntWrapper, #IntWrapper.property
1940+ // CHECK: to set_deallocating %0 : $IntWrapper
1941+ // CHECK: MayEscape: %4 = begin_access [modify] [dynamic] [no_nested_conflict] %3 : $*Int64
1942+ // CHECK: to set_deallocating %0 : $IntWrapper
1943+ sil @testEndAccess : $@convention(thin) () -> () {
1944+ bb0:
1945+ %0 = alloc_ref $IntWrapper
1946+ %1 = integer_literal $Builtin.Int64, 0
1947+ %2 = struct $Int64 (%1 : $Builtin.Int64)
1948+ %3 = ref_element_addr %0 : $IntWrapper, #IntWrapper.property
1949+ %4 = begin_access [modify] [dynamic] [no_nested_conflict] %3 : $*Int64
1950+ store %2 to %4 : $*Int64
1951+ end_access %4 : $*Int64
1952+ set_deallocating %0 : $IntWrapper
1953+ dealloc_ref %0 : $IntWrapper
1954+ %9 = tuple ()
1955+ return %9 : $()
1956+ }
1957+
19301958// -----------------------------------------------------------------------------
19311959// Unreachable blocks are not mapped to the connection graph. Test
19321960// that verification does not assert with "Missing escape connection
0 commit comments