File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -558,6 +558,10 @@ bool SILFunction::hasNonUniqueDefinition() const {
558558 if (!getASTContext ().LangOpts .hasFeature (Feature::Embedded))
559559 return false ;
560560
561+ // If this function is the entrypoint, it is unique.
562+ if (getName () == getASTContext ().getEntryPointFunctionName ())
563+ return false ;
564+
561565 // If this is for a declaration, ask it.
562566 if (auto declRef = getDeclRef ()) {
563567 return declRef.hasNonUniqueDefinition ();
Original file line number Diff line number Diff line change 5656// RUN: %target-run %t/Application | %FileCheck %s
5757
5858// Test #%: All "intermediate", all the time. Main drives code generation
59- // TODO: @main needs to drive the generation of code here.
6059// RUN: %target-swift-frontend -c -emit-module -o %t/Root.o %t/Root.swift -enable-experimental-feature Embedded -enable-experimental-feature DeferredCodeGen -parse-as-library
6160// RUN: %target-swift-frontend -c -I %t -emit-module -o %t/ClientA.o %t/ClientA.swift -enable-experimental-feature Embedded -enable-experimental-feature DeferredCodeGen -parse-as-library
6261// RUN: %target-swift-frontend -c -I %t -emit-module -o %t/ClientB.o %t/ClientB.swift -enable-experimental-feature Embedded -enable-experimental-feature DeferredCodeGen -parse-as-library
6362// RUN: %target-swift-frontend -c -I %t -emit-module -o %t/Application.o %t/Application.swift -enable-experimental-feature Embedded -enable-experimental-feature DeferredCodeGen -parse-as-library
64- // RUN-TODO : %target-clang %target-clang-resource-dir-opt %t/Root.o %t/ClientA.o %t/ClientB.o %t/Application.o -o %t/Application
65- // RUN-TODO : %target-run %t/Application | %FileCheck %s
63+ // RUN: %target-clang %target-clang-resource-dir-opt %t/Root.o %t/ClientA.o %t/ClientB.o %t/Application.o -o %t/Application
64+ // RUN: %target-run %t/Application | %FileCheck %s
6665
6766
6867// REQUIRES: swift_in_compiler
You can’t perform that action at this time.
0 commit comments