mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Autolinking was added to the frontend in22912bc3b. It was disabled on Linux in198402dcf, and further constrained to be disabled on "linux-gnu" in83b4384fa. Since then, more flavors of Linux have become supported by Swift: "linux-gnueabihf" in4bf81e09d, and "freebsd" inf41b791d4. Autolinking most likely does not work on any of these platforms, so mark it as unsupported for now. Other tests that only mark "linux-gnu" as unsupported do so for similar reasons. Ensure unsupported tests for "linux-gnu" are also unsupported on similar platforms.
45 lines
1.9 KiB
Swift
45 lines
1.9 KiB
Swift
// RUN: rm -rf %t
|
|
// RUN: mkdir -p %t
|
|
// RUN: %target-swift-frontend %s -sdk %S/Inputs -I %S/Inputs/custom-modules -emit-ir -o %t/without-adapter.ll
|
|
// RUN: FileCheck %s < %t/without-adapter.ll
|
|
|
|
// RUN: %target-swift-frontend -emit-module %S/Inputs/adapter.swift -sdk %S/Inputs -module-link-name SwiftAdapter -module-name ClangModuleWithAdapter -I %S/Inputs/custom-modules -o %t
|
|
// RUN: %target-swift-frontend %s -sdk %S/Inputs -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 -emit-ir -disable-autolink-framework LinkFramework -o %t/with-disabled.ll
|
|
// RUN: FileCheck --check-prefix=CHECK-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: OS=linux-gnu
|
|
// UNSUPPORTED: OS=linux-gnueabihf
|
|
// UNSUPPORTED: OS=freebsd
|
|
|
|
import LinkMusket
|
|
import LinkFramework
|
|
import ClangModuleUser
|
|
import IndirectFrameworkImporter
|
|
import UsesSubmodule
|
|
|
|
_ = LinkFramework.IComeFromLinkFramework
|
|
UsesSubmodule.useSomethingFromSubmodule()
|
|
|
|
// CHECK: !{{[0-9]+}} = !{i32 6, !"Linker Options", ![[LINK_LIST:[0-9]+]]}
|
|
// CHECK: ![[LINK_LIST]] = !{
|
|
|
|
// CHECK-DAG: !{{[0-9]+}} = !{!"-lLock"}
|
|
// CHECK-DAG: !{{[0-9]+}} = !{!"-lStock"}
|
|
// CHECK-DAG: !{{[0-9]+}} = !{!"-framework", !"Barrel"}
|
|
// CHECK-DAG: !{{[0-9]+}} = !{!"-framework", !"LinkFramework"}
|
|
// CHECK-DAG: !{{[0-9]+}} = !{!"-lUnderlyingClangLibrary"}
|
|
// CHECK-DAG: !{{[0-9]+}} = !{!"-framework", !"Indirect"}
|
|
// CHECK-DAG: !{{[0-9]+}} = !{!"-framework", !"HasSubmodule"}
|
|
|
|
// CHECK-WITH-SWIFT: !{{[0-9]+}} = !{!"-lSwiftAdapter"}
|
|
|
|
// CHECK-WITH-DISABLED: !{!"-framework", !"Barrel"}
|
|
// CHECK-WITH-DISABLED-NOT: !{!"-framework", !"LinkFramework"}
|
|
// CHECK-WITH-DISABLED: !{!"-framework", !"Indirect"}
|