|
1 | 1 | // RUN: %empty-directory(%t)
|
2 |
| -// RUN: split-file %s %t |
| 2 | +// RUN: split-file %s %t --leading-lines |
3 | 3 |
|
4 | 4 | /// Build 2 libs.
|
5 |
| -// RUN: %target-swift-frontend -emit-module %t/empty.swift -o %t/A.swiftmodule \ |
| 5 | +// RUN: %target-swift-frontend -emit-module %t/empty.swift -o %t/SwiftModuleA.swiftmodule \ |
6 | 6 | // RUN: -enable-library-evolution -swift-version 5
|
7 |
| -// RUN: %target-swift-frontend -emit-module %t/empty.swift -o %t/B.swiftmodule \ |
| 7 | +// RUN: %target-swift-frontend -emit-module %t/empty.swift -o %t/SwiftModuleB.swiftmodule \ |
8 | 8 | // RUN: -enable-library-evolution -swift-version 5
|
9 | 9 |
|
10 | 10 | /// Build a client with and without library-evolution.
|
|
19 | 19 | // RUN: %target-swift-frontend -typecheck %t/Crypto.swift -I %t -verify \
|
20 | 20 | // RUN: -module-name Crypto
|
21 | 21 |
|
| 22 | +//--- module.modulemap |
| 23 | +module ClangModuleA { |
| 24 | + header "ClangModuleA.h" |
| 25 | + |
| 26 | + module Submodule { |
| 27 | + header "ClangSubmodule.h" |
| 28 | + } |
| 29 | +} |
| 30 | + |
| 31 | +module ClangModuleB { |
| 32 | + header "ClangModuleB.h" |
| 33 | +} |
| 34 | + |
| 35 | +//--- ClangModuleA.h |
| 36 | +//--- ClangSubmodule.h |
| 37 | +//--- ClangModuleB.h |
| 38 | + |
22 | 39 | //--- empty.swift
|
23 | 40 |
|
24 | 41 | //--- client-non-resilient.swift
|
25 |
| -@_implementationOnly import A // expected-warning {{using '@_implementationOnly' without enabling library evolution for 'main' may lead to instability during execution}} |
26 |
| -import B |
| 42 | +@_implementationOnly import SwiftModuleA // expected-warning {{using '@_implementationOnly' without enabling library evolution for 'main' may lead to instability during execution}} |
| 43 | +@_implementationOnly import SwiftModuleA // expected-warning {{using '@_implementationOnly' without enabling library evolution for 'main' may lead to instability during execution}} |
| 44 | +import SwiftModuleB |
| 45 | + |
| 46 | +@_implementationOnly import ClangModuleA // expected-warning {{using '@_implementationOnly' without enabling library evolution for 'main' may lead to instability during execution}} |
| 47 | +@_implementationOnly import ClangModuleA.Submodule // expected-warning {{using '@_implementationOnly' without enabling library evolution for 'main' may lead to instability during execution}} |
| 48 | +import ClangModuleB |
27 | 49 |
|
28 | 50 | //--- client-resilient.swift
|
29 |
| -@_implementationOnly import A |
| 51 | +@_implementationOnly import SwiftModuleA |
| 52 | +// expected-warning @-1 {{'@_implementationOnly' is deprecated, use 'internal import' instead}} |
| 53 | +import SwiftModuleB |
| 54 | + |
| 55 | +@_implementationOnly import ClangModuleA |
| 56 | +// expected-warning @-1 {{'@_implementationOnly' is deprecated, use 'internal import' instead}} |
| 57 | +@_implementationOnly import ClangModuleA.Submodule |
30 | 58 | // expected-warning @-1 {{'@_implementationOnly' is deprecated, use 'internal import' instead}}
|
31 |
| -import B |
| 59 | +import ClangModuleB |
32 | 60 |
|
33 | 61 | //--- Crypto.swift
|
34 |
| -@_implementationOnly import A // expected-warning {{using '@_implementationOnly' without enabling library evolution for 'Crypto' may lead to instability during execution}} |
35 |
| -import B |
| 62 | +@_implementationOnly import SwiftModuleA // expected-warning {{using '@_implementationOnly' without enabling library evolution for 'Crypto' may lead to instability during execution}} |
| 63 | +import SwiftModuleB |
36 | 64 | @_implementationOnly import CCryptoBoringSSL
|
| 65 | +import ClangModuleB |
0 commit comments