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 {
538
538
// The main entry-point is public.
539
539
if (kind == Kind::EntryPoint)
540
540
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
+ }
543
548
544
549
// Calling convention thunks have shared linkage.
545
550
if (isForeignToNativeThunk ())
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ func asyncFunc() async {
40
40
41
41
42
42
// async_Main
43
- // CHECK-SIL-LABEL: sil hidden @async_Main : $@convention(thin) @async () -> () {
43
+ // CHECK-SIL-LABEL: sil private @async_Main : $@convention(thin) @async () -> () {
44
44
// call main
45
45
// CHECK-SIL: %0 = metatype $@thin MyProgram.Type // user: %2
46
46
// CHECK-SIL-NEXT: // function_ref static MyProgram.$main()
Original file line number Diff line number Diff line change 3
3
// a
4
4
// CHECK-LABEL: sil_global hidden @$s24toplevel_globalactorvars1aSivp : $Int
5
5
6
- // CHECK-LABEL: sil hidden [ossa] @async_Main
6
+ // CHECK-LABEL: sil private [ossa] @async_Main
7
7
// CHECK: bb0:
8
8
// CHECK-NEXT: // function_ref
9
9
// CHECK-NEXT: [[GET_MAIN:%.*]] = function_ref @swift_task_getMainExecutor
You can’t perform that action at this time.
0 commit comments