Skip to content

Commit 5d9e7b9

Browse files
committed
[test] TBD: add a tbd gen test for generating linker directives
1 parent c31b966 commit 5d9e7b9

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

test/TBD/linker-directives.swift

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// REQUIRES: VENDOR=apple
2+
// RUN: %empty-directory(%t)
3+
4+
// RUN: %target-swift-frontend -typecheck %s -tbd-is-installapi -emit-tbd -emit-tbd-path %t/linker_directives.tbd
5+
// RUN: %FileCheck %s --check-prefix CHECK-HAS --check-prefix CHECK-HAS-NOT < %t/linker_directives.tbd
6+
// RUN: %target-swift-frontend -typecheck %s -emit-tbd -emit-tbd-path %t/linker_directives.tbd
7+
// RUN: %FileCheck %s --check-prefix CHECK-HAS --check-prefix CHECK-HAS-NOT < %t/linker_directives.tbd
8+
9+
@available(OSX 10.8, *)
10+
@_originallyDefinedIn(module: "ToasterKit", macOS 10.15)
11+
public func toast() {}
12+
13+
// CHECK-HAS: $ld$hide$os10.14$_$s10ToasterKit5toastyyF
14+
// CHECK-HAS: $ld$hide$os10.8$_$s10ToasterKit5toastyyF
15+
16+
// CHECK-HAS-NOT-NOT: $ld$hide$os10.15$_$s10ToasterKit5toastyyF
17+
// CHECK-HAS-NOT-NOT: $ld$hide$os10.7$_$s10ToasterKit5toastyyF

0 commit comments

Comments
 (0)