mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Way back in Swift 1 I was trying to draw a distinction between "overlays", separate libraries that added Swift content to an existing Objective-C framework, and "the Swift part of a mixed-source framework", even though they're implemented in almost exactly the same way. "Adapter module" was the term that covered both of those. In practice, however, no one knew what "adapter" meant. Bring an end to this confusion by just using "overlay" within the compiler even for the mixed-source framework case. No intended functionality change.
43 lines
2.1 KiB
Swift
43 lines
2.1 KiB
Swift
// RUN: %empty-directory(%t)
|
|
|
|
// RUN: %target-swift-frontend %s -sdk %S/Inputs -Fsystem %S/Inputs/System/Library/Frameworks -enable-objc-interop -I %S/Inputs/custom-modules -emit-ir -o - | %FileCheck %s
|
|
|
|
// RUN: %target-swift-frontend -emit-module %S/Inputs/overlay.swift -sdk %S/Inputs -module-link-name SwiftOverlay -module-name ClangModuleWithOverlay -I %S/Inputs/custom-modules -o %t
|
|
|
|
// RUN: %target-swift-frontend %s -sdk %S/Inputs -Fsystem %S/Inputs/System/Library/Frameworks -enable-objc-interop -I %S/Inputs/custom-modules -I %t -emit-ir -o %t/with-adapter.ll
|
|
// RUN: %FileCheck %s < %t/with-adapter.ll
|
|
// RUN: %FileCheck -check-prefix CHECK-WITH-SWIFT %s < %t/with-adapter.ll
|
|
|
|
// RUN: %target-swift-frontend %s -sdk %S/Inputs -I %S/Inputs/custom-modules -Fsystem %S/Inputs/System/Library/Frameworks -enable-objc-interop -emit-ir -disable-autolink-framework LinkFramework -o - > %t/with-disabled.ll
|
|
// RUN: %FileCheck -check-prefix CHECK-WITH-DISABLED %s < %t/with-disabled.ll
|
|
// RUN: %FileCheck -check-prefix NEGATIVE-WITH-DISABLED %s < %t/with-disabled.ll
|
|
|
|
// Linux uses a different autolinking mechanism, based on
|
|
// swift-autolink-extract. This file tests the Darwin mechanism.
|
|
// UNSUPPORTED: autolink-extract
|
|
|
|
import LinkMusket
|
|
import LinkFramework
|
|
import ClangModuleUser
|
|
import IndirectFrameworkImporter
|
|
import UsesSubmodule
|
|
|
|
_ = LinkFramework.IComeFromLinkFramework
|
|
UsesSubmodule.useSomethingFromSubmodule()
|
|
|
|
// CHECK: !llvm.linker.options = !{
|
|
|
|
// CHECK-DAG: !{{[0-9]+}} = !{!{{"-lLock"|"/DEFAULTLIB:Lock.lib"}}}
|
|
// CHECK-DAG: !{{[0-9]+}} = !{!{{"-lStock"|"/DEFAULTLIB:Stock.lib"}}}
|
|
// CHECK-DAG: !{{[0-9]+}} = !{!"-framework", !"Barrel"}
|
|
// CHECK-DAG: !{{[0-9]+}} = !{!"-framework", !"LinkFramework"}
|
|
// CHECK-DAG: !{{[0-9]+}} = !{!{{"-lUnderlyingClangLibrary"|"/DEFAULTLIB:UnderlyingClangLibrary.lib"}}}
|
|
// CHECK-DAG: !{{[0-9]+}} = !{!"-framework", !"Indirect"}
|
|
// CHECK-DAG: !{{[0-9]+}} = !{!"-framework", !"HasSubmodule"}
|
|
|
|
// CHECK-WITH-SWIFT: !{{[0-9]+}} = !{!{{"-lSwiftOverlay"|"/DEFAULTLIB:SwiftOverlay.lib"}}}
|
|
|
|
// CHECK-WITH-DISABLED-DAG: !{!"-framework", !"Barrel"}
|
|
// CHECK-WITH-DISABLED-DAG: !{!"-framework", !"Indirect"}
|
|
// NEGATIVE-WITH-DISABLED-NOT: !"LinkFramework"
|