File tree Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Original file line number Diff line number Diff line change @@ -1865,6 +1865,11 @@ static llvm::GlobalObject *createForceImportThunk(IRGenModule &IGM) {
18651865}
18661866
18671867void IRGenModule::emitAutolinkInfo () {
1868+ if (getSILModule ().getOptions ().StopOptimizationAfterSerialization ) {
1869+ // We're asked to emit an empty IR module
1870+ return ;
1871+ }
1872+
18681873 auto Autolink =
18691874 AutolinkKind::create (TargetInfo, Triple, IRGen.Opts .LLVMLTOKind );
18701875
Original file line number Diff line number Diff line change 1+ // RUN: %empty-directory(%t)
2+ // RUN: split-file %s %t
3+
4+ // RUN: %target-swift-frontend -target armv7em-none-none-eabi -enable-experimental-feature Embedded -c -I%t -parse-as-library %t/MyModuleA.swift -o %t/MyModuleA.o -emit-module -emit-module-path %t/MyModuleA.swiftmodule -emit-empty-object-file
5+ // RUN: %target-swift-frontend -target armv7em-none-none-eabi -enable-experimental-feature Embedded -c -I%t -parse-as-library %t/MyModuleB.swift -o %t/MyModuleB.o -emit-module -emit-module-path %t/MyModuleB.swiftmodule -emit-empty-object-file
6+ // RUN: %target-swift-frontend -target armv7em-none-none-eabi -enable-experimental-feature Embedded -c -I%t -parse-as-library %t/MyModuleC.swift -o %t/MyModuleC.o -emit-module -emit-module-path %t/MyModuleC.swiftmodule -emit-empty-object-file
7+ // RUN: %target-swift-frontend -target armv7em-none-none-eabi -enable-experimental-feature Embedded -c -I%t %t/Main.swift -o %t/Main.o
8+ // RUN: %target-clang %t/Main.o %t/MyModuleA.o %t/MyModuleB.o %t/MyModuleC.o -o %t/a.out
9+
10+ // REQUIRES: swift_in_compiler
11+ // REQUIRES: OS=macosx || OS=linux-gnu
12+ // REQUIRES: CODEGENERATOR=ARM
13+
14+ //--- MyModuleA.swift
15+
16+ public func a( ) { }
17+
18+ //--- MyModuleB.swift
19+
20+ import MyModuleA
21+
22+ public func b( ) { }
23+
24+ //--- MyModuleC.swift
25+
26+ import MyModuleB
27+
28+ public func c( ) { }
29+
30+ //--- Main.swift
31+
32+ import MyModuleA
33+ import MyModuleB
34+ import MyModuleC
35+
36+ a ( )
37+ b ( )
38+ c ( )
You can’t perform that action at this time.
0 commit comments