File tree Expand file tree Collapse file tree 2 files changed +20
-4
lines changed Expand file tree Collapse file tree 2 files changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -874,6 +874,9 @@ void IRGenModule::emitAutolinkInfo() {
874
874
AutolinkEntries.end ());
875
875
876
876
switch (TargetInfo.OutputObjectFormat ) {
877
+ case llvm::Triple::UnknownObjectFormat:
878
+ llvm_unreachable (" unknown object format" );
879
+ case llvm::Triple::COFF:
877
880
case llvm::Triple::MachO: {
878
881
llvm::LLVMContext &ctx = Module.getContext ();
879
882
@@ -892,7 +895,6 @@ void IRGenModule::emitAutolinkInfo() {
892
895
}
893
896
break ;
894
897
}
895
- case llvm::Triple::COFF:
896
898
case llvm::Triple::ELF: {
897
899
// Merge the entries into null-separated string.
898
900
llvm::SmallString<64 > EntriesString;
@@ -918,9 +920,6 @@ void IRGenModule::emitAutolinkInfo() {
918
920
addUsedGlobal (var);
919
921
break ;
920
922
}
921
- default :
922
- llvm_unreachable (" Don't know how to emit autolink entries for "
923
- " the selected object format." );
924
923
}
925
924
926
925
if (!IRGen.Opts .ForceLoadSymbolName .empty ()) {
Original file line number Diff line number Diff line change
1
+ // RUN: rm -rf %t
2
+ // RUN: mkdir -p %t
3
+ // RUN: %swift -target thumbv7--windows-gnu -parse-as-library -parse-stdlib -emit-module-path %t/module.swiftmodule -module-name module -module-link-name module %s
4
+ // RUN: %swift -target thumbv7--windows-gnu -parse-as-library -parse-stdlib -module-name autolink -I %t -D MAIN_MODULE -emit-ir -o - %s | FileCheck %s -check-prefix CHECK-GNU-IR
5
+ // RUN: %swift -target thumbv7--windows-gnu -parse-as-library -parse-stdlib -module-name autolink -I %t -D MAIN_MODULE -S -o - %s | FileCheck %s -check-prefix CHECK-GNU-ASM
6
+
7
+ #if MAIN_MODULE
8
+ import module
9
+ #endif
10
+
11
+ // CHECK-GNU-IR: !{{[0-9]+}} = !{i32 {{[0-9]+}}, !"Linker Options", [[NODE:![0-9]+]]}
12
+ // CHECK-GNU-IR: [[NODE]] = !{[[LIST:![0-9]+]]}
13
+ // CHECK-GNU-IR: [[LIST]] = !{!"-lmodule"}
14
+
15
+ // CHECK-GNU-ASM: .section .drectve
16
+ // CHECK-GNU-ASM: .ascii " -lmodule"
17
+
You can’t perform that action at this time.
0 commit comments