File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -1326,6 +1326,27 @@ bb0(%0 : $Optional<(foo, foo)>):
1326
1326
}
1327
1327
1328
1328
1329
+ // Check if externally available functions are optimized.
1330
+
1331
+ sil public_external [noinline] @externally_available_with_dead_arg : $@convention(thin) (@guaranteed foo) -> () {
1332
+ bb0(%0 : $foo):
1333
+ %r = tuple()
1334
+ return %r : $()
1335
+ }
1336
+
1337
+ // CHECK-LABEL: sil @call_externally_available
1338
+ // CHECK: [[F:%[0-9]+]] = function_ref @_TTSf4d__externally_available_with_dead_arg : $@convention(thin) () -> ()
1339
+ // CHECK: apply [[F]]()
1340
+ // CHECK: return
1341
+ sil @call_externally_available : $@convention(thin) (@guaranteed foo) -> () {
1342
+ bb0(%0 : $foo):
1343
+ %f = function_ref @externally_available_with_dead_arg : $@convention(thin) (@guaranteed foo) -> ()
1344
+ %a = apply %f(%0) : $@convention(thin) (@guaranteed foo) -> ()
1345
+ %r = tuple()
1346
+ return %r : $()
1347
+ }
1348
+
1349
+
1329
1350
// We should remove the array semantic from specialized calls.
1330
1351
1331
1352
// CHECK-LABEL: sil [fragile] [thunk] [always_inline] [_semantics "array.foobar"] @array_semantic : $@convention(method) (@owned Builtin.NativeObject) -> () {
You can’t perform that action at this time.
0 commit comments