Skip to content

Commit 5a64127

Browse files
committed
NFC: Add tests verifying that @_weakLinked import is not transitive.
1 parent 4389458 commit 5a64127

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// RUN: %empty-directory(%t)
2+
//
3+
// RUN: %target-swift-frontend -emit-module -emit-module-path %t/weaklinked_import_helper.swiftmodule -parse-as-library %S/Inputs/weaklinked_import_helper.swift -enable-library-evolution
4+
//
5+
// RUN: echo '@_weakLinked import weaklinked_import_helper' > %t/intermediate.swift
6+
// RUN: %target-swift-frontend -emit-module -emit-module-path %t/intermediate.swiftmodule -parse-as-library %t/intermediate.swift -I %t -enable-library-evolution
7+
//
8+
// RUN: %target-swift-frontend -primary-file %s -I %t -emit-ir | %FileCheck %s
9+
10+
// UNSUPPORTED: OS=windows-msvc
11+
12+
import intermediate
13+
import weaklinked_import_helper
14+
15+
// Symbols from weaklinked_import_helper should be strong, despite intermediate
16+
// importining the module @_weakLinked.
17+
18+
// CHECK-DAG: declare swiftcc {{.+}} @"$s24weaklinked_import_helper2fnyyF"()
19+
fn()
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// RUN: %empty-directory(%t)
2+
//
3+
// RUN: echo 'public struct S {}' > %t/Other.swift
4+
// RUN: %target-swift-frontend -emit-module -emit-module-path %t/Other.swiftmodule -parse-as-library %t/Other.swift -enable-library-evolution
5+
//
6+
// RUN: %target-swift-emit-module-interface(%t/WeakLinksOther.swiftinterface) %s -I %t
7+
// RUN: %target-swift-typecheck-module-from-interface(%t/WeakLinksOther.swiftinterface) -I %t
8+
// RUN: %FileCheck %s < %t/WeakLinksOther.swiftinterface
9+
10+
// UNSUPPORTED: OS=windows-msvc
11+
12+
// The @_weakLinked attribute should not be printed in swiftinterfaces.
13+
// CHECK-NOT: @_weakLinked
14+
@_weakLinked import Other

0 commit comments

Comments
 (0)