@@ -1022,6 +1022,9 @@ sil [ossa] @closure6 : $@convention(thin) (@guaranteed Y, @guaranteed Y) -> @own
10221022[%1: escape c*.v** => %r.c*.v**]
10231023}
10241024
1025+ sil @take_noescape_closure : $@convention(thin) (@guaranteed @noescape @callee_guaranteed (@guaranteed Y) -> ()) -> ()
1026+ sil @take_escaping_closure : $@convention(thin) (@owned @callee_guaranteed (@guaranteed Y) -> ()) -> ()
1027+
10251028// CHECK-LABEL: Escape information for callClosure1:
10261029// CHECK: - : %0 = alloc_ref $Y
10271030// CHECK: global: %1 = alloc_ref $Y
@@ -1332,8 +1335,8 @@ sil @test_debug_value : $@convention(thin) () -> () {
13321335}
13331336
13341337// CHECK-LABEL: Escape information for test_walk_up_partial_apply_argument:
1335- // CHECK: global: %0 = alloc_ref $Y // users: %3, %2
1336- // CHECK: global: %6 = alloc_ref $X // user: %7
1338+ // CHECK: global: %0 = alloc_ref $Y
1339+ // CHECK: global: %6 = alloc_ref $X
13371340// CHECK: End function test_walk_up_partial_apply_argument
13381341sil @test_walk_up_partial_apply_argument : $@convention(thin) () -> () {
13391342bb0:
@@ -1350,6 +1353,36 @@ bb0:
13501353 return %13 : $()
13511354}
13521355
1356+ // CHECK-LABEL: Escape information for test_escaping_closure:
1357+ // CHECK: global: %0 = alloc_ref $Y
1358+ // CHECK: End function test_escaping_closure
1359+ sil @test_escaping_closure : $@convention(thin) () -> () {
1360+ bb0:
1361+ %0 = alloc_ref $Y
1362+ %1 = function_ref @closure1 : $@convention(thin) (@guaranteed Y, @guaranteed Y) -> ()
1363+ %2 = partial_apply [callee_guaranteed] %1(%0) : $@convention(thin) (@guaranteed Y, @guaranteed Y) -> ()
1364+ %3 = function_ref @take_escaping_closure : $@convention(thin) (@owned @callee_guaranteed (@guaranteed Y) -> ()) -> ()
1365+ %5 = apply %3(%2) : $@convention(thin) (@owned @callee_guaranteed (@guaranteed Y) -> ()) -> ()
1366+ %13 = tuple ()
1367+ return %13 : $()
1368+ }
1369+
1370+ // CHECK-LABEL: Escape information for test_noescape_partial_apply_and_convert_function:
1371+ // CHECK: - : %0 = alloc_ref $Y
1372+ // CHECK: End function test_noescape_partial_apply_and_convert_function
1373+ sil @test_noescape_partial_apply_and_convert_function : $@convention(thin) () -> () {
1374+ bb0:
1375+ %0 = alloc_ref $Y
1376+ %1 = function_ref @closure1 : $@convention(thin) (@guaranteed Y, @guaranteed Y) -> ()
1377+ %2 = partial_apply [callee_guaranteed] [on_stack] %1(%0) : $@convention(thin) (@guaranteed Y, @guaranteed Y) -> ()
1378+ %3 = convert_function %2 : $@noescape @callee_guaranteed (@guaranteed Y) -> () to $@noescape @callee_guaranteed (@guaranteed Y) -> ()
1379+ %4 = function_ref @take_noescape_closure : $@convention(thin) (@guaranteed @noescape @callee_guaranteed (@guaranteed Y) -> ()) -> ()
1380+ %5 = apply %4(%3) : $@convention(thin) (@guaranteed @noescape @callee_guaranteed (@guaranteed Y) -> ()) -> ()
1381+ dealloc_stack %2 : $@noescape @callee_guaranteed (@guaranteed Y) -> ()
1382+ %13 = tuple ()
1383+ return %13 : $()
1384+ }
1385+
13531386// CHECK-LABEL: Escape information for test_mismatching_existential_types:
13541387// CHECK: - : %1 = alloc_ref $Y
13551388// CHECK: End function test_mismatching_existential_types
0 commit comments