|
7 | 7 | // RUN: %target-swift-frontend -build-module-from-parseable-interface -serialize-parseable-module-interface-dependency-hashes -sdk %t/my-sdk -prebuilt-module-cache-path %t/prebuilt-cache -I %t/my-sdk -module-cache-path %t/MCP -o %t/prebuilt-cache/ExportedLib.swiftmodule -track-system-dependencies -module-name ExportedLib %t/my-sdk/ExportedLib.swiftinterface |
8 | 8 | // RUN: %target-swift-frontend -build-module-from-parseable-interface -serialize-parseable-module-interface-dependency-hashes -sdk %t/my-sdk -prebuilt-module-cache-path %t/prebuilt-cache -I %t/my-sdk -module-cache-path %t/MCP -o %t/prebuilt-cache/SdkLib.swiftmodule -track-system-dependencies -module-name SdkLib %t/my-sdk/SdkLib.swiftinterface |
9 | 9 | // |
| 10 | +// Check the prebuilt modules don't contain dependencies in the module cache or prebuilt cache |
| 11 | +// RUN: llvm-bcanalyzer -dump %t/prebuilt-cache/ExportedLib.swiftmodule | %FileCheck %s -check-prefix=PREBUILT |
| 12 | +// RUN: llvm-bcanalyzer -dump %t/prebuilt-cache/SdkLib.swiftmodule | %FileCheck %s -check-prefix=PREBUILT |
| 13 | +// |
| 14 | +// PREBUILT: MODULE_BLOCK |
| 15 | +// PREBUILT-NOT: FILE_DEPENDENCY {{.*}}/MCP/{{.*}} |
| 16 | +// PREBUILT-NOT: FILE_DEPENDENCY {{.*}}/prebuilt-cache/{{.*}} |
| 17 | +// |
| 18 | +// Re-build them in the opposite order |
| 19 | +// RUN: %empty-directory(%t/prebuilt-cache) |
| 20 | +// RUN: %empty-directory(%t/MCP) |
| 21 | +// RUN: %target-swift-frontend -build-module-from-parseable-interface -serialize-parseable-module-interface-dependency-hashes -sdk %t/my-sdk -prebuilt-module-cache-path %t/prebuilt-cache -I %t/my-sdk -module-cache-path %t/MCP -o %t/prebuilt-cache/SdkLib.swiftmodule -track-system-dependencies -module-name SdkLib %t/my-sdk/SdkLib.swiftinterface |
| 22 | +// RUN: %target-swift-frontend -build-module-from-parseable-interface -serialize-parseable-module-interface-dependency-hashes -sdk %t/my-sdk -prebuilt-module-cache-path %t/prebuilt-cache -I %t/my-sdk -module-cache-path %t/MCP -o %t/prebuilt-cache/ExportedLib.swiftmodule -track-system-dependencies -module-name ExportedLib %t/my-sdk/ExportedLib.swiftinterface |
| 23 | +// |
| 24 | +// Check they still don't contain dependencies in the module cache or prebuilt cache |
| 25 | +// RUN: llvm-bcanalyzer -dump %t/prebuilt-cache/ExportedLib.swiftmodule | %FileCheck %s -check-prefix=PREBUILT |
| 26 | +// RUN: llvm-bcanalyzer -dump %t/prebuilt-cache/SdkLib.swiftmodule | %FileCheck %s -check-prefix=PREBUILT |
| 27 | +// |
10 | 28 | // RUN: %empty-directory(%t/MCP) |
11 | 29 | // RUN: echo '1: PASSED' |
12 | 30 |
|
|
20 | 38 | // RUN: test -f %t/MCP/SdkLib-*.swiftmodule |
21 | 39 | // |
22 | 40 | // Check they are *not* forwarding modules |
23 | | -// RUN: head -n 1 %t/MCP/SdkLib-*.swiftmodule | not grep -e '---' |
24 | | -// RUN: head -n 1 %t/MCP/ExportedLib-*.swiftmodule | not grep -e '---' |
| 41 | +// RUN: not %{python} %S/Inputs/check-is-forwarding-module.py %t/MCP/SdkLib-*.swiftmodule |
| 42 | +// RUN: not %{python} %S/Inputs/check-is-forwarding-module.py %t/MCP/ExportedLib-*.swiftmodule |
| 43 | +// |
| 44 | +// Check they don't contain dependencies in the module cache (..or prebuilt cache) |
| 45 | +// RUN: llvm-bcanalyzer -dump %t/MCP/SdkLib-*.swiftmodule | %FileCheck %s -check-prefix=PREBUILT |
| 46 | +// RUN: llvm-bcanalyzer -dump %t/MCP/ExportedLib-*.swiftmodule | %FileCheck %s -check-prefix=PREBUILT |
25 | 47 | // |
26 | 48 | // RUN: %empty-directory(%t/MCP) |
27 | 49 | // RUN: echo '2: PASSED' |
|
36 | 58 | // RUN: test -f %t/MCP/ExportedLib-*.swiftmodule |
37 | 59 | // |
38 | 60 | // Check they *are* forwarding modules |
39 | | -// RUN: head -n 1 %t/MCP/SdkLib-*.swiftmodule | grep -e '---' |
40 | | -// RUN: head -n 1 %t/MCP/ExportedLib-*.swiftmodule | grep -e '---' |
| 61 | +// RUN: %{python} %S/Inputs/check-is-forwarding-module.py %t/MCP/SdkLib-*.swiftmodule |
| 62 | +// RUN: %{python} %S/Inputs/check-is-forwarding-module.py %t/MCP/ExportedLib-*.swiftmodule |
41 | 63 | // |
42 | 64 | // Check they contain the expected dependencies |
43 | 65 | // RUN: cat %t/MCP/ExportedLib-*.swiftmodule | %FileCheck %s -check-prefix=EXLIB |
|
49 | 71 | // EXLIB-DAG: /my-sdk/ExportedLib.swiftinterface |
50 | 72 | // SDKLIB-DAG: /my-sdk/SdkLib.swiftinterface |
51 | 73 | // |
| 74 | +// Check they don't contain any dependencies from either cache other than themselves |
| 75 | +// RUN: cat %t/MCP/ExportedLib-*.swiftmodule | %FileCheck %s -check-prefix=NOCACHE -DLIB_NAME=ExportedLib |
| 76 | +// RUN: cat %t/MCP/SdkLib-*.swiftmodule | %FileCheck %s -check-prefix=NOCACHE -DLIB_NAME=SdkLib |
| 77 | +// |
| 78 | +// NOCACHE: dependencies: |
| 79 | +// NOCACHE-NOT: /prebuilt-cache/ |
| 80 | +// NOCACHE-NOT: /MCP/ |
| 81 | +// NOCACHE: /prebuilt-cache/[[LIB_NAME]].swiftmodule |
| 82 | +// NOCACHE-NOT: /prebuilt-cache/ |
| 83 | +// NOCACHE-NOT: /MCP/ |
| 84 | +// |
52 | 85 | // RUN: %empty-directory(%t/MCP) |
53 | 86 | // RUN: echo '3: PASSED' |
54 | 87 |
|
55 | 88 |
|
56 | 89 | // 4) Move the SDK without changing its contents |
57 | 90 | // |
58 | 91 | // RUN: mv %t/my-sdk %t/my-new-sdk |
59 | | -// RUN: mv %t/prebuilt-cache %t/new-prebuilt-cache |
60 | | -// RUN: %target-swift-frontend -typecheck -I %t/my-new-sdk -sdk %t/my-new-sdk -prebuilt-module-cache-path %t/new-prebuilt-cache -module-cache-path %t/MCP -emit-dependencies-path %t/dummy.d -track-system-dependencies %s |
| 92 | +// RUN: mkdir %t/new-dir |
| 93 | +// RUN: mv %t/prebuilt-cache %t/new-dir/ |
| 94 | +// RUN: %target-swift-frontend -typecheck -I %t/my-new-sdk -sdk %t/my-new-sdk -prebuilt-module-cache-path %t/new-dir/prebuilt-cache -module-cache-path %t/MCP -emit-dependencies-path %t/dummy.d -track-system-dependencies %s |
61 | 95 | // |
62 | 96 | // Check SdkLib and ExportedLib are in the module cache |
63 | 97 | // RUN: test -f %t/MCP/SdkLib-*.swiftmodule |
64 | 98 | // RUN: test -f %t/MCP/ExportedLib-*.swiftmodule |
65 | 99 | // |
66 | 100 | // Check they are still both forwarding modules |
67 | | -// RUN: head -n 1 %t/MCP/SdkLib-*.swiftmodule | grep -e '---' |
68 | | -// RUN: head -n 1 %t/MCP/ExportedLib-*.swiftmodule | grep -e '---' |
| 101 | +// RUN: %{python} %S/Inputs/check-is-forwarding-module.py %t/MCP/SdkLib-*.swiftmodule |
| 102 | +// RUN: %{python} %S/Inputs/check-is-forwarding-module.py %t/MCP/ExportedLib-*.swiftmodule |
69 | 103 | // |
70 | 104 | // Check they contain the expected dependencies |
71 | 105 | // RUN: cat %t/MCP/ExportedLib-*.swiftmodule | %FileCheck %s -check-prefix=NEW-EXLIB |
|
76 | 110 | // NEW-EXLIB-DAG: /my-new-sdk/ExportedLib.swiftinterface |
77 | 111 | // NEW-SDKLIB-DAG: /my-new-sdk/SdkLib.swiftinterface |
78 | 112 | // |
| 113 | +// Check they don't contain dependencies from the module cache, old prebuilt |
| 114 | +// cache, or new prebuilt cache |
| 115 | +// RUN: cat %t/MCP/ExportedLib-*.swiftmodule | %FileCheck %s -check-prefix=NOCACHE -DLIB_NAME=ExportedLib |
| 116 | +// RUN: cat %t/MCP/SdkLib-*.swiftmodule | %FileCheck %s -check-prefix=NOCACHE -DLIB_NAME=SdkLib |
| 117 | +// |
79 | 118 | // RUN: %empty-directory(%t/MCP) |
80 | 119 | // RUN: echo '4: PASSED' |
81 | 120 |
|
82 | 121 |
|
83 | 122 | // 5) Now change the SDK's content and check it no longer uses the prebuilt modules |
84 | 123 | // |
85 | 124 | // RUN: echo "// size change" >> %t/my-new-sdk/SdkLib.swiftinterface |
86 | | -// RUN: %target-swift-frontend -typecheck -I %t/my-new-sdk -sdk %t/my-new-sdk -prebuilt-module-cache-path %t/new-prebuilt-cache -module-cache-path %t/MCP -emit-dependencies-path %t/dummy.d -track-system-dependencies %s |
| 125 | +// RUN: %target-swift-frontend -typecheck -I %t/my-new-sdk -sdk %t/my-new-sdk -prebuilt-module-cache-path %t/new-dir/prebuilt-cache -module-cache-path %t/MCP -emit-dependencies-path %t/dummy.d -track-system-dependencies %s |
87 | 126 | // |
88 | 127 | // Check SDKLib and ExportedLib are in the module cache |
89 | 128 | // RUN: test -f %t/MCP/SdkLib-*.swiftmodule |
90 | 129 | // RUN: test -f %t/MCP/ExportedLib-*.swiftmodule |
91 | 130 | // |
92 | 131 | // Check ExportedLib is still a forwarding module and SdkLib is not |
93 | | -// RUN: head -n 1 %t/MCP/ExportedLib-*.swiftmodule | grep -e '---' |
94 | | -// RUN: head -n 1 %t/MCP/SdkLib-*.swiftmodule | not grep -e '---' |
| 132 | +// RUN: %{python} %S/Inputs/check-is-forwarding-module.py %t/MCP/ExportedLib-*.swiftmodule |
| 133 | +// RUN: not %{python} %S/Inputs/check-is-forwarding-module.py %t/MCP/SdkLib-*.swiftmodule |
95 | 134 | // |
96 | 135 | // Check ExportedLib still contains the same dependencies |
97 | 136 | // RUN: cat %t/MCP/ExportedLib-*.swiftmodule | %FileCheck %s -check-prefix=NEW-EXLIB |
| 137 | +// RUN: cat %t/MCP/ExportedLib-*.swiftmodule | %FileCheck %s -check-prefix=NOCACHE -DLIB_NAME=ExportedLib |
| 138 | +// |
| 139 | +// Check SdkLib doesn't contain dependencies in the module cache or prebuilt cache |
| 140 | +// RUN: llvm-bcanalyzer -dump %t/MCP/SdkLib-*.swiftmodule | %FileCheck %s -check-prefix=PREBUILT |
98 | 141 | // |
99 | 142 | // RUN: %empty-directory(%t/MCP) |
100 | 143 | // |
|
106 | 149 | // RUN: test -f %t/MCP/ExportedLib-*.swiftmodule |
107 | 150 | // |
108 | 151 | // Check neither are forwarding modules |
109 | | -// RUN: head -n 1 %t/MCP/SdkLib-*.swiftmodule | not grep -e '---' |
110 | | -// RUN: head -n 1 %t/MCP/ExportedLib-*.swiftmodule | not grep -e '---' |
| 152 | +// RUN: not %{python} %S/Inputs/check-is-forwarding-module.py %t/MCP/SdkLib-*.swiftmodule |
| 153 | +// RUN: not %{python} %S/Inputs/check-is-forwarding-module.py %t/MCP/ExportedLib-*.swiftmodule |
| 154 | +// |
| 155 | +// Check neither contains dependencies in the module cache or prebuilt cache |
| 156 | +// RUN: llvm-bcanalyzer -dump %t/MCP/ExportedLib-*.swiftmodule | %FileCheck %s -check-prefix=PREBUILT |
| 157 | +// RUN: llvm-bcanalyzer -dump %t/MCP/SdkLib-*.swiftmodule | %FileCheck %s -check-prefix=PREBUILT |
111 | 158 | // |
112 | 159 | // RUN: echo '5: PASSED' |
113 | 160 |
|
|
0 commit comments