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 11/// A module should be able to leak SPI types from an import through SPI decls
22
33// 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
78
8- #if LIB_A
9- // expected-note@-1{{add import of module 'A'}}{{1-1=@_spi(A) import A\n}}
9+ //--- A.swift
1010@_spi ( A) public struct SecretStruct {
1111 @_spi ( A) public func bar( ) { }
1212}
1313
14- #elseif LIB_B
14+ //--- B.swift
1515
1616@_spi ( A) import A
1717
1818@_spi ( B) public func foo( ) -> SecretStruct { fatalError ( ) }
1919
20- #elseif LIB_C
20+ //--- C.swift
2121
2222@_spi ( B) import B
23-
23+ // expected-note{{add import of module 'A'}}{{1-1=@_spi(A) import A\n}}
2424var a = foo ( ) // OK
2525a. bar ( ) // expected-error{{instance method 'bar()' is not available due to missing import of defining module 'A'}}
2626
2727var b = SecretStruct ( ) // expected-error{{cannot find 'SecretStruct' in scope}}
28-
29- #endif
You can’t perform that action at this time.
0 commit comments