Skip to content

Commit c8ada27

Browse files
committed
test: add a module interface test
1 parent d98429a commit c8ada27

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// RUN: %empty-directory(%t)
2+
// RUN: %target-swift-frontend -parse-as-library %s -emit-module -library-level=api -emit-module-path %t/Foo.swiftmodule -module-name Foo -emit-module-interface-path %t/Foo.swiftinterface -emit-private-module-interface-path %t/Foo.private.swiftinterface
3+
4+
// RUN: %target-swift-frontend -compile-module-from-interface %t/Foo.swiftinterface -o %t/Foo.public.swiftmodule -module-name Foo
5+
// RUN: %target-swift-frontend -compile-module-from-interface %t/Foo.private.swiftinterface -o %t/Foo.private.swiftmodule -module-name Foo
6+
7+
@_spi_available(macOS 10.10, *)
8+
@available(iOS 8.0, *)
9+
public class SPIClass {}
10+
11+
// RUN: %FileCheck %s -check-prefix CHECK-PUBLIC < %t/Foo.swiftinterface
12+
// RUN: %FileCheck %s -check-prefix CHECK-PRIVATE < %t/Foo.private.swiftinterface
13+
14+
// CHECK-PUBLIC: @available(macOS, unavailable)
15+
// CHECK-PRIVATE: @_spi_available(macOS, introduced: 10.10)

0 commit comments

Comments
 (0)