|
1 | 1 | // RUN: %empty-directory(%t)
|
2 |
| -// RUN: %empty-directory(%t/cache) |
| 2 | +// RUN: %empty-directory(%t/cache0) |
| 3 | +// RUN: %empty-directory(%t/cache1) |
| 4 | +// RUN: cp -r %S/../Sema/Inputs/public-private-sdk %t/sdk |
3 | 5 | // REQUIRES: VENDOR=apple
|
4 | 6 |
|
5 | 7 | /// Prepare the SDK.
|
| 8 | +//// stdlib |
| 9 | +// RUN: %target-swift-frontend -emit-module -module-name Swift -enable-library-evolution -swift-version 5 \ |
| 10 | +// RUN: -disable-implicit-concurrency-module-import -disable-implicit-string-processing-module-import -Osize \ |
| 11 | +// RUN: %t/sdk/usr/lib/swift/Swift.swiftmodule/source.swift \ |
| 12 | +// RUN: -o %t/sdk/usr/lib/swift/Swift.swiftmodule/%target-swiftmodule-name \ |
| 13 | +// RUN: -emit-module-interface-path %t/sdk/usr/lib/swift/Swift.swiftmodule/%target-swiftinterface-name \ |
| 14 | +// RUN: -parse-stdlib |
| 15 | +// RUN: %target-swift-typecheck-module-from-interface(%t/sdk/usr/lib/swift/Swift.swiftmodule/%target-swiftinterface-name) -module-name Swift -parse-stdlib |
| 16 | + |
6 | 17 | //// Public framework
|
7 |
| -// RUN: cp -r %S/../Sema/Inputs/public-private-sdk %t/sdk |
8 | 18 | // RUN: %target-swift-frontend -emit-module -module-name PublicSwift -enable-library-evolution -swift-version 5 \
|
| 19 | +// RUN: -disable-implicit-concurrency-module-import -disable-implicit-string-processing-module-import -Osize -sdk %t/sdk \ |
9 | 20 | // RUN: %t/sdk/System/Library/Frameworks/PublicSwift.framework/Modules/PublicSwift.swiftmodule/source.swift \
|
10 | 21 | // RUN: -o %t/sdk/System/Library/Frameworks/PublicSwift.framework/Modules/PublicSwift.swiftmodule/%target-swiftmodule-name \
|
11 | 22 | // RUN: -emit-module-interface-path %t/sdk/System/Library/Frameworks/PublicSwift.framework/Modules/PublicSwift.swiftmodule/%target-swiftinterface-name
|
12 | 23 | // RUN: %target-swift-typecheck-module-from-interface(%t/sdk/System/Library/Frameworks/PublicSwift.framework/Modules/PublicSwift.swiftmodule/%target-swiftinterface-name) -module-name PublicSwift
|
13 | 24 |
|
14 | 25 | //// Private framework
|
15 | 26 | // RUN: %target-swift-frontend -emit-module -module-name PrivateSwift -enable-library-evolution -swift-version 5 \
|
| 27 | +// RUN: -disable-implicit-concurrency-module-import -disable-implicit-string-processing-module-import -Osize -sdk %t/sdk \ |
16 | 28 | // RUN: %t/sdk/System/Library/PrivateFrameworks/PrivateSwift.framework/Modules/PrivateSwift.swiftmodule/source.swift \
|
17 | 29 | // RUN: -o %t/sdk/System/Library/PrivateFrameworks/PrivateSwift.framework/Modules/PrivateSwift.swiftmodule/%target-swiftmodule-name \
|
18 | 30 | // RUN: -emit-module-interface-path %t/sdk/System/Library/PrivateFrameworks/PrivateSwift.framework/Modules/PrivateSwift.swiftmodule/%target-swiftinterface-name
|
19 | 31 | // RUN: %target-swift-typecheck-module-from-interface(%t/sdk/System/Library/PrivateFrameworks/PrivateSwift.framework/Modules/PrivateSwift.swiftmodule/%target-swiftinterface-name) -module-name PrivateSwift
|
20 | 32 |
|
21 | 33 | //// Public library
|
22 | 34 | // RUN: %target-swift-frontend -emit-module -module-name PublicSwiftLibrary -enable-library-evolution -swift-version 5 \
|
| 35 | +// RUN: -disable-implicit-concurrency-module-import -disable-implicit-string-processing-module-import -Osize -sdk %t/sdk \ |
23 | 36 | // RUN: %t/sdk/usr/lib/swift/PublicSwiftLibrary.swiftmodule/source.swift \
|
24 | 37 | // RUN: -o %t/sdk/usr/lib/swift/PublicSwiftLibrary.swiftmodule/%target-swiftmodule-name \
|
25 | 38 | // RUN: -emit-module-interface-path %t/sdk/usr/lib/swift/PublicSwiftLibrary.swiftmodule/%target-swiftinterface-name
|
26 | 39 | // RUN: %target-swift-typecheck-module-from-interface(%t/sdk/usr/lib/swift/PublicSwiftLibrary.swiftmodule/%target-swiftinterface-name) -module-name PublicSwiftLibrary
|
27 | 40 |
|
28 | 41 | //// Public subframework
|
29 | 42 | // RUN: %target-swift-frontend -emit-module -module-name SubSwift -enable-library-evolution -swift-version 5 \
|
| 43 | +// RUN: -disable-implicit-concurrency-module-import -disable-implicit-string-processing-module-import -Osize -sdk %t/sdk \ |
30 | 44 | // RUN: %t/sdk/System/Library/SubFrameworks/SubSwift.framework/Modules/SubSwift.swiftmodule/source.swift \
|
31 | 45 | // RUN: -o %t/sdk/System/Library/SubFrameworks/SubSwift.framework/Modules/SubSwift.swiftmodule/%target-swiftmodule-name \
|
32 | 46 | // RUN: -emit-module-interface-path %t/sdk/System/Library/SubFrameworks/SubSwift.framework/Modules/SubSwift.swiftmodule/%target-swiftinterface-name
|
|
38 | 52 | // RUN: echo "This is a malformed swiftmodule" > %t/sdk/System/Library/SubFrameworks/SubSwift.framework/Modules/SubSwift.swiftmodule/%target-swiftmodule-name
|
39 | 53 | // RUN: echo "This is a malformed swiftmodule" > %t/sdk/usr/lib/swift/PublicSwiftLibrary.swiftmodule/%target-swiftmodule-name
|
40 | 54 |
|
41 |
| -/// There should be no attempt at loading the malformed PublicSwift swiftmodule. |
42 |
| -/// This means no notes about: |
| 55 | +/// Check the loading behavior from attempts at loading the malformed swiftmodules, |
| 56 | +/// printing the notes: |
43 | 57 | /// * compiled module is out of date
|
44 | 58 | /// * unable to load compiled module '*': malformed
|
| 59 | + |
| 60 | +/// Check diagnostics in the local file: |
45 | 61 | // RUN: %target-swift-frontend -typecheck %s -sdk %t/sdk \
|
46 |
| -// RUN: -module-name Main -module-cache-path %t/cache \ |
47 |
| -// RUN: -F %t/sdk/System/Library/PrivateFrameworks/ \ |
48 |
| -// RUN: -verify -Rmodule-interface-rebuild |
| 62 | +// RUN: -disable-implicit-concurrency-module-import -disable-implicit-string-processing-module-import \ |
| 63 | +// RUN: -module-name Main -module-cache-path %t/cache0 \ |
| 64 | +// RUN: -F %t/sdk/System/Library/PrivateFrameworks/ -resource-dir "" \ |
| 65 | +// RUN: -verify -verify-ignore-unknown -Rmodule-interface-rebuild -diagnostic-style=llvm |
| 66 | + |
| 67 | +/// Check diagnostic for implicit imports: |
| 68 | +// RUN: echo "This is a malformed swiftmodule" > %t/sdk/usr/lib/swift/Swift.swiftmodule/%target-swiftmodule-name |
| 69 | +// RUN: %target-swift-frontend -typecheck %s -sdk %t/sdk \ |
| 70 | +// RUN: -disable-implicit-concurrency-module-import -disable-implicit-string-processing-module-import \ |
| 71 | +// RUN: -module-name Main -module-cache-path %t/cache1 \ |
| 72 | +// RUN: -F %t/sdk/System/Library/PrivateFrameworks/ -resource-dir "" \ |
| 73 | +// RUN: -Rmodule-interface-rebuild -Rmodule-loading -diagnostic-style=llvm 2> %t/out |
| 74 | +// RUN: %FileCheck --input-file %t/out %s |
| 75 | + |
| 76 | +import Swift |
| 77 | +// CHECK: rebuilding module 'Swift' from interface |
| 78 | +// CHECK-NEXT: compiled module is out of date |
| 79 | +// CHECK-NEXT: : malformed |
49 | 80 |
|
50 | 81 | import PublicSwift // expected-remark {{rebuilding module 'PublicSwift' from interface}}
|
51 | 82 | // expected-note @-1 {{was ignored because it belongs to a framework in the SDK}}
|
|
0 commit comments