File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change 1
1
/// A module should be able to leak SPI types from an import through SPI decls
2
2
3
3
// RUN: %empty-directory(%t)
4
- // RUN: %target-swift-frontend -emit-module -DLIB_A %s -module-name A -emit-module-path %t/A.swiftmodule
5
- // RUN: %target-swift-frontend -emit-module -DLIB_B %s -module-name B -emit-module-path %t/B.swiftmodule -I %t
6
- // RUN: %target-swift-frontend -typecheck -verify -verify-ignore-unknown -DLIB_C %s -I %t
4
+ // RUN: split-file %s %t
5
+ // RUN: %target-swift-frontend -emit-module %t/A.swift -module-name A -emit-module-path %t/A.swiftmodule
6
+ // RUN: %target-swift-frontend -emit-module %t/B.swift -module-name B -emit-module-path %t/B.swiftmodule -I %t
7
+ // RUN: %target-swift-frontend -typecheck -verify -verify-ignore-unknown %t/C.swift -I %t
7
8
8
- #if LIB_A
9
- // expected-note@-1{{add import of module 'A'}}{{1-1=@_spi(A) import A\n}}
9
+ //--- A.swift
10
10
@_spi ( A) public struct SecretStruct {
11
11
@_spi ( A) public func bar( ) { }
12
12
}
13
13
14
- #elseif LIB_B
14
+ //--- B.swift
15
15
16
16
@_spi ( A) import A
17
17
18
18
@_spi ( B) public func foo( ) -> SecretStruct { fatalError ( ) }
19
19
20
- #elseif LIB_C
20
+ //--- C.swift
21
21
22
22
@_spi ( B) import B
23
-
23
+ // expected-note{{add import of module 'A'}}{{1-1=@_spi(A) import A\n}}
24
24
var a = foo ( ) // OK
25
25
a. bar ( ) // expected-error{{instance method 'bar()' is not available due to missing import of defining module 'A'}}
26
26
27
27
var b = SecretStruct ( ) // expected-error{{cannot find 'SecretStruct' in scope}}
28
-
29
- #endif
You can’t perform that action at this time.
0 commit comments