mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Merge pull request #85463 from DougGregor/autolink-multithreaded-ir
[Multi-threaded IRGen] Ensure that autolink info gets into each object file
This commit is contained in:
35
test/IRGen/autolink_multithread.swift
Normal file
35
test/IRGen/autolink_multithread.swift
Normal file
@@ -0,0 +1,35 @@
|
||||
// This test checks that we produce autolink entries into the expected places
|
||||
// when performing multi-threaded IR generation.
|
||||
|
||||
// RUN: %empty-directory(%t/src)
|
||||
// RUN: split-file %s %t/src
|
||||
|
||||
// RUN: %target-swift-frontend -emit-module -o %t -module-name empty -module-link-name empty %S/../Inputs/empty.swift
|
||||
|
||||
// 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
|
||||
// RUN: %FileCheck --check-prefix=CHECK-A %s <%t/A.ll
|
||||
// RUN: %FileCheck --check-prefix=CHECK-B %s <%t/B.ll
|
||||
|
||||
// Linux uses a different autolinking mechanism, based on
|
||||
// swift-autolink-extract. This file tests the Darwin mechanism.
|
||||
// UNSUPPORTED: autolink-extract
|
||||
// REQUIRES: OS=macosx
|
||||
|
||||
|
||||
//--- A.swift
|
||||
import empty
|
||||
|
||||
public func f() -> String { "hello" }
|
||||
|
||||
// CHECK-A: !llvm.linker.options = !{
|
||||
// CHECK-A: !{{[0-9]+}} = !{!{{"-lempty"|"/DEFAULTLIB:empty.lib"}}}
|
||||
|
||||
//--- B.swift
|
||||
import LinkFramework
|
||||
|
||||
public func useLibrarySym() {
|
||||
let _ = LinkFramework.IComeFromLinkFramework
|
||||
}
|
||||
|
||||
// CHECK-B: !llvm.linker.options = !{
|
||||
// CHECK-B: !{{[0-9]+}} = !{!"-framework", !"LinkFramework"}
|
||||
Reference in New Issue
Block a user