File tree Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change
1
+ // RUN: %empty-directory(%t)
2
+ // RUN: not %target-swift-frontend -target %target-cpu-apple-macosx11.9 -parse-as-library %s -typecheck -library-level=api >& %t/macos.txt
3
+ // RUN: %FileCheck %s < %t/macos.txt
4
+
5
+ // RUN: %target-swift-frontend -target arm64-apple-ios13.0 -parse-as-library %s -typecheck -library-level=api
6
+
7
+ @_spi_available ( macOS 10 . 10 , * )
8
+ @available ( iOS 8 . 0 , * )
9
+ public class SPIClass { }
10
+
11
+ public func foo( _ c: SPIClass ) { }
12
+
13
+ // CHECK: cannot use class 'SPIClass' here; it is SPI
Original file line number Diff line number Diff line change
1
+ // RUN: %empty-directory(%t)
2
+ // RUN: %empty-directory(%t/macos)
3
+ // RUN: %empty-directory(%t/ios)
4
+
5
+ // RUN: %target-swift-frontend -target %target-cpu-apple-macosx11.9 -parse-as-library %s -emit-module -library-level=api -emit-module-path %t/macos/Foo.swiftmodule -module-name Foo -DFoo
6
+ // RUN: %target-swift-frontend -target arm64-apple-ios13.0 -parse-as-library %s -emit-module -library-level=api -emit-module-path %t/ios/Foo.swiftmodule -module-name Foo -DFoo
7
+
8
+ // RUN: not %target-swift-frontend -target %target-cpu-apple-macosx11.9 -parse-as-library %s -typecheck -library-level=api -I %t/macos >& %t/macos.txt
9
+ // RUN: %FileCheck %s < %t/macos.txt
10
+
11
+ // RUN: %target-swift-frontend -target arm64-apple-ios13.0 -parse-as-library %s -typecheck -library-level=api -I %t/ios
12
+
13
+ #if Foo
14
+
15
+ @_spi_available ( macOS 10 . 10 , * )
16
+ @available ( iOS 8 . 0 , * )
17
+ public class SPIClass { }
18
+
19
+ #else
20
+
21
+ import Foo
22
+ public func foo( _ c: SPIClass ) { }
23
+
24
+ #endif
25
+
26
+ // CHECK: cannot use class 'SPIClass' here; it is an SPI imported from 'Foo'
You can’t perform that action at this time.
0 commit comments