We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
async_Main
1 parent 356bfd5 commit e212bd5Copy full SHA for e212bd5
lib/SIL/IR/SILDeclRef.cpp
@@ -538,8 +538,13 @@ SILLinkage SILDeclRef::getDefinitionLinkage() const {
538
// The main entry-point is public.
539
if (kind == Kind::EntryPoint)
540
return SILLinkage::Public;
541
- if (kind == Kind::AsyncEntryPoint)
542
- return SILLinkage::Hidden;
+ if (kind == Kind::AsyncEntryPoint) {
+ // 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
+ }
548
549
// Calling convention thunks have shared linkage.
550
if (isForeignToNativeThunk())
0 commit comments