File tree Expand file tree Collapse file tree 2 files changed +36
-3
lines changed Expand file tree Collapse file tree 2 files changed +36
-3
lines changed Original file line number Diff line number Diff line change @@ -1740,9 +1740,7 @@ static void performParallelIRGeneration(IRGenDescriptor desc) {
17401740
17411741 (void )layoutStringsEnabled (*IGM, /* diagnose*/ true );
17421742
1743- // Only need to do this once.
1744- if (!IGMcreated)
1745- IGM->addLinkLibraries ();
1743+ IGM->addLinkLibraries ();
17461744 IGMcreated = true ;
17471745 }
17481746
Original file line number Diff line number Diff line change 1+ // This test checks that we produce autolink entries into the expected places
2+ // when performing multi-threaded IR generation.
3+
4+ // RUN: %empty-directory(%t/src)
5+ // RUN: split-file %s %t/src
6+
7+ // RUN: %target-swift-frontend -emit-module -o %t -module-name empty -module-link-name empty %S/../Inputs/empty.swift
8+
9+ // RUN: %target-swift-frontend -emit-ir %t/src/A.swift %t/src/B.swift -I %t -Fsystem %S/Inputs/Frameworks -o %t/A.ll -o %t/B.ll -num-threads 2 -O -g -module-name test
10+ // RUN: %FileCheck --check-prefix=CHECK-A %s <%t/A.ll
11+ // RUN: %FileCheck --check-prefix=CHECK-B %s <%t/B.ll
12+
13+ // Linux uses a different autolinking mechanism, based on
14+ // swift-autolink-extract. This file tests the Darwin mechanism.
15+ // UNSUPPORTED: autolink-extract
16+ // REQUIRES: OS=macosx
17+
18+
19+ //--- A.swift
20+ import empty
21+
22+ public func f( ) -> String { " hello " }
23+
24+ // CHECK-A: !llvm.linker.options = !{
25+ // CHECK-A: !{{[0-9]+}} = !{!{{"-lempty"|"/DEFAULTLIB:empty.lib"}}}
26+
27+ //--- B.swift
28+ import LinkFramework
29+
30+ public func useLibrarySym( ) {
31+ let _ = LinkFramework . IComeFromLinkFramework
32+ }
33+
34+ // CHECK-B: !llvm.linker.options = !{
35+ // CHECK-B: !{{[0-9]+}} = !{!"-framework", !"LinkFramework"}
You can’t perform that action at this time.
0 commit comments