File tree Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -538,8 +538,13 @@ SILLinkage SILDeclRef::getDefinitionLinkage() const {
538538 // The main entry-point is public.
539539 if (kind == Kind::EntryPoint)
540540 return SILLinkage::Public;
541- if (kind == Kind::AsyncEntryPoint)
542- return SILLinkage::Hidden;
541+ if (kind == Kind::AsyncEntryPoint) {
542+ // async main entrypoint is referenced only from @main and
543+ // they are in the same SIL module. Hiding this entrypoint
544+ // from other object file makes it possible to link multiple
545+ // executable targets for SwiftPM testing with -entry-point-function-name
546+ return SILLinkage::Private;
547+ }
543548
544549 // Calling convention thunks have shared linkage.
545550 if (isForeignToNativeThunk ())
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ func asyncFunc() async {
4040
4141
4242// async_Main
43- // CHECK-SIL-LABEL: sil hidden @async_Main : $@convention(thin) @async () -> () {
43+ // CHECK-SIL-LABEL: sil private @async_Main : $@convention(thin) @async () -> () {
4444// call main
4545// CHECK-SIL: %0 = metatype $@thin MyProgram.Type // user: %2
4646// CHECK-SIL-NEXT: // function_ref static MyProgram.$main()
Original file line number Diff line number Diff line change 33// a
44// CHECK-LABEL: sil_global hidden @$s24toplevel_globalactorvars1aSivp : $Int
55
6- // CHECK-LABEL: sil hidden [ossa] @async_Main
6+ // CHECK-LABEL: sil private [ossa] @async_Main
77// CHECK: bb0:
88// CHECK-NEXT: // function_ref
99// CHECK-NEXT: [[GET_MAIN:%.*]] = function_ref @swift_task_getMainExecutor
You can’t perform that action at this time.
0 commit comments