|
14 | 14 | /// Expect warnings when building a public client.
|
15 | 15 | // RUN: %target-swift-frontend -typecheck -sdk %t/sdk -module-cache-path %t %s \
|
16 | 16 | // RUN: -F %t/sdk/System/Library/PrivateFrameworks/ \
|
17 |
| -// RUN: -library-level api -verify -D PUBLIC_IMPORTS |
| 17 | +// RUN: -library-level api -verify -D PUBLIC_IMPORTS -module-name MainLib |
18 | 18 |
|
19 | 19 | /// Expect no warnings when building an SPI client.
|
20 | 20 | // RUN: %target-swift-frontend -typecheck -sdk %t/sdk -module-cache-path %t %s \
|
21 | 21 | // RUN: -F %t/sdk/System/Library/PrivateFrameworks/ \
|
22 |
| -// RUN: -library-level spi -D PUBLIC_IMPORTS |
| 22 | +// RUN: -library-level spi -D PUBLIC_IMPORTS -module-name MainLib |
23 | 23 |
|
24 | 24 | /// The driver should also accept the flag and pass it along.
|
25 | 25 | // RUN: %target-swiftc_driver -typecheck -sdk %t/sdk -module-cache-path %t %s \
|
26 | 26 | // RUN: -F %t/sdk/System/Library/PrivateFrameworks/ \
|
27 |
| -// RUN: -library-level spi -D PUBLIC_IMPORTS |
| 27 | +// RUN: -library-level spi -D PUBLIC_IMPORTS -module-name MainLib |
28 | 28 |
|
29 | 29 | /// Expect no warnings when building a client with some other library level.
|
30 | 30 | // RUN: %target-swift-frontend -typecheck -sdk %t/sdk -module-cache-path %t %s \
|
31 | 31 | // RUN: -F %t/sdk/System/Library/PrivateFrameworks/ \
|
32 |
| -// RUN: -D PUBLIC_IMPORTS |
| 32 | +// RUN: -D PUBLIC_IMPORTS -module-name MainLib |
33 | 33 | // RUN: %target-swift-frontend -typecheck -sdk %t/sdk -module-cache-path %t %s \
|
34 | 34 | // RUN: -F %t/sdk/System/Library/PrivateFrameworks/ \
|
35 |
| -// RUN: -library-level other -D PUBLIC_IMPORTS |
| 35 | +// RUN: -library-level other -D PUBLIC_IMPORTS -module-name MainLib |
36 | 36 | #if PUBLIC_IMPORTS
|
37 | 37 | import PublicSwift
|
38 |
| -import PrivateSwift // expected-error{{private module 'PrivateSwift' is imported publicly from the public module 'main'}} |
| 38 | +import PrivateSwift // expected-error{{private module 'PrivateSwift' is imported publicly from the public module 'MainLib'}} |
39 | 39 |
|
40 | 40 | import PublicClang
|
41 |
| -import PublicClang_Private // expected-error{{private module 'PublicClang_Private' is imported publicly from the public module 'main'}} |
42 |
| -import FullyPrivateClang // expected-error{{private module 'FullyPrivateClang' is imported publicly from the public module 'main'}} |
43 |
| -import main // expected-warning{{'implementation-only-import-suggestion.swift' is part of module 'main'; ignoring import}} |
| 41 | +import PublicClang_Private // expected-error{{private module 'PublicClang_Private' is imported publicly from the public module 'MainLib'}} |
| 42 | +import FullyPrivateClang // expected-error{{private module 'FullyPrivateClang' is imported publicly from the public module 'MainLib'}} |
| 43 | +@_exported import MainLib // expected-warning{{private module 'MainLib' is imported publicly from the public module 'MainLib'}} |
44 | 44 |
|
45 | 45 | /// Expect no warnings with implementation-only imports.
|
46 | 46 | // RUN: %target-swift-frontend -typecheck -sdk %t/sdk -module-cache-path %t %s \
|
|
0 commit comments