3
3
// RUN: %empty-directory(%t)
4
4
// RUN: %empty-directory(%t/module-cache)
5
5
// RUN: %empty-directory(%t/Modules)
6
+ // RUN: %empty-directory(%t/ExtraCModules)
6
7
7
8
// RUN: split-file %s %t
8
9
9
10
// Build Module D
10
11
// RUN: %target-swift-frontend -emit-module %t/D.swift -emit-module-path %t/Modules/D.swiftmodule/%target-swiftmodule-name -module-name D -enable-library-evolution -emit-module-interface-path %t/Modules/D.swiftmodule/%target-swiftinterface-name
11
12
12
13
// Build Module C
13
- // RUN: %target-swift-frontend -emit-module %t/C.swift -emit-module-path %t/Modules/C.swiftmodule/%target-swiftmodule-name -module-name C -enable-library-evolution -emit-module-interface-path %t/Modules/C.swiftmodule/%target-swiftinterface-name -I %t/Modules/
14
+ // RUN: %target-swift-frontend -emit-module %t/C.swift -emit-module-path %t/Modules/C.swiftmodule/%target-swiftmodule-name -module-name C -enable-library-evolution -emit-module-interface-path %t/Modules/C.swiftmodule/%target-swiftinterface-name -I %t/Modules -I %t/ExtraCModules
14
15
15
16
// Build Module B
16
- // RUN: %target-swift-frontend -emit-module %t/B.swift -emit-module-path %t/Modules/B.swiftmodule/%target-swiftmodule-name -module-name B -enable-library-evolution -emit-module-interface-path %t/Modules/B.swiftmodule/%target-swiftinterface-name -I %t/Modules/
17
+ // RUN: %target-swift-frontend -emit-module %t/B.swift -emit-module-path %t/Modules/B.swiftmodule/%target-swiftmodule-name -module-name B -enable-library-evolution -emit-module-interface-path %t/Modules/B.swiftmodule/%target-swiftinterface-name -I %t/Modules -I %t/ExtraCModules
17
18
18
19
// Build Module A
19
- // RUN: %target-swift-frontend -emit-module %t/A.swift -emit-module-path %t/Modules/A.swiftmodule/%target-swiftmodule-name -module-name A -enable-library-evolution -emit-module-interface-path %t/Modules/A.swiftmodule/%target-swiftinterface-name -I %t/Modules/
20
+ // RUN: %target-swift-frontend -emit-module %t/A.swift -emit-module-path %t/Modules/A.swiftmodule/%target-swiftmodule-name -module-name A -enable-library-evolution -emit-module-interface-path %t/Modules/A.swiftmodule/%target-swiftinterface-name -I %t/Modules -I %t/ExtraCModules
20
21
21
22
// Initial Scan Client module
22
- // RUN: %target-swift-frontend -scan-dependencies -scanner-module-validation -module-load-mode prefer-interface -Rdependency-scan-cache -serialize-dependency-scan-cache -dependency-scan-cache-path %t/cache.moddepcache -module-cache-path %t/module-cache %t/Client.swift -o %t/deps_initial.json -I %t/Modules -I %S/../Inputs/CHeaders -module-name Client
23
+ // RUN: %target-swift-frontend -scan-dependencies -scanner-module-validation -module-load-mode prefer-interface -Rdependency-scan-cache -serialize-dependency-scan-cache -dependency-scan-cache-path %t/cache.moddepcache -module-cache-path %t/module-cache %t/Client.swift -o %t/deps_initial.json -I %t/Modules -I %t/ExtraCModules -I % S/../Inputs/CHeaders -module-name Client
23
24
24
25
// Clean re-scan
25
- // RUN: %target-swift-frontend -scan-dependencies -scanner-module-validation -module-load-mode prefer-interface -Rdependency-scan-cache -load-dependency-scan-cache -dependency-scan-cache-path %t/cache.moddepcache -module-cache-path %t/module-cache %t/Client.swift -o %t/deps_clean_rescan.json -I %t/Modules -I %S/../Inputs/CHeaders -module-name Client -serialize-dependency-scan-cache -validate-prior-dependency-scan-cache &> %t/clean_incremental_scan_output.txt
26
+ // RUN: %target-swift-frontend -scan-dependencies -scanner-module-validation -module-load-mode prefer-interface -Rdependency-scan-cache -load-dependency-scan-cache -dependency-scan-cache-path %t/cache.moddepcache -module-cache-path %t/module-cache %t/Client.swift -o %t/deps_clean_rescan.json -I %t/Modules -I %t/ExtraCModules -I % S/../Inputs/CHeaders -module-name Client -serialize-dependency-scan-cache -validate-prior-dependency-scan-cache &> %t/clean_incremental_scan_output.txt
26
27
// RUN: cat %t/clean_incremental_scan_output.txt | %FileCheck %s -check-prefix=CLEAN-INCREMENTAL-SCAN-CHECK
27
28
28
29
// Touch C and re-scan
29
30
// RUN: touch %t/Modules/C.swiftmodule/%target-swiftinterface-name
30
- // RUN: %target-swift-frontend -scan-dependencies -scanner-module-validation -module-load-mode prefer-interface -Rdependency-scan-cache -load-dependency-scan-cache -dependency-scan-cache-path %t/cache.moddepcache -module-cache-path %t/module-cache %t/Client.swift -o %t/deps_stale_C_rescan.json -I %t/Modules -I %S/../Inputs/CHeaders -module-name Client -serialize-dependency-scan-cache -validate-prior-dependency-scan-cache &> %t/stale_C_incremental_scan_output.txt
31
+ // RUN: %target-swift-frontend -scan-dependencies -scanner-module-validation -module-load-mode prefer-interface -Rdependency-scan-cache -load-dependency-scan-cache -dependency-scan-cache-path %t/cache.moddepcache -module-cache-path %t/module-cache %t/Client.swift -o %t/deps_stale_C_rescan.json -I %t/Modules -I %t/ExtraCModules -I % S/../Inputs/CHeaders -module-name Client -serialize-dependency-scan-cache -validate-prior-dependency-scan-cache &> %t/stale_C_incremental_scan_output.txt
31
32
// RUN: cat %t/stale_C_incremental_scan_output.txt | %FileCheck %s -check-prefix=STALE-C-INCREMENTAL-SCAN-CHECK
32
33
33
34
// Clean re-scan
34
- // RUN: %target-swift-frontend -scan-dependencies -scanner-module-validation -module-load-mode prefer-interface -Rdependency-scan-cache -load-dependency-scan-cache -dependency-scan-cache-path %t/cache.moddepcache -module-cache-path %t/module-cache %t/Client.swift -o %t/deps_clean_rescan_2.json -I %t/Modules -I %S/../Inputs/CHeaders -module-name Client -serialize-dependency-scan-cache -validate-prior-dependency-scan-cache &> %t/clean_incremental_scan_output_2.txt
35
+ // RUN: %target-swift-frontend -scan-dependencies -scanner-module-validation -module-load-mode prefer-interface -Rdependency-scan-cache -load-dependency-scan-cache -dependency-scan-cache-path %t/cache.moddepcache -module-cache-path %t/module-cache %t/Client.swift -o %t/deps_clean_rescan_2.json -I %t/Modules -I %t/ExtraCModules -I % S/../Inputs/CHeaders -module-name Client -serialize-dependency-scan-cache -validate-prior-dependency-scan-cache &> %t/clean_incremental_scan_output_2.txt
35
36
// RUN: cat %t/clean_incremental_scan_output_2.txt | %FileCheck %s -check-prefix=CLEAN-INCREMENTAL-SCAN-CHECK
36
37
37
38
// Replace a module dependency in A, ensure re-scan detects it
38
39
// RUN: echo "import X" > %t/A.swift
39
- // RUN: %target-swift-frontend -emit-module %t/A.swift -emit-module-path %t/Modules/A.swiftmodule/%target-swiftmodule-name -module-name A -enable-library-evolution -emit-module-interface-path %t/Modules/A.swiftmodule/%target-swiftinterface-name -I %t/Modules/ -I %S/../Inputs/CHeaders
40
+ // RUN: %target-swift-frontend -emit-module %t/A.swift -emit-module-path %t/Modules/A.swiftmodule/%target-swiftmodule-name -module-name A -enable-library-evolution -emit-module-interface-path %t/Modules/A.swiftmodule/%target-swiftinterface-name -I %t/Modules -I %t/ExtraCModules -I %S/../Inputs/CHeaders
40
41
41
42
// Re-scan to ensure A gets scanned again and the new dependency is picked up.
42
- // RUN: %target-swift-frontend -scan-dependencies -scanner-module-validation -module-load-mode prefer-interface -Rdependency-scan-cache -load-dependency-scan-cache -dependency-scan-cache-path %t/cache.moddepcache -module-cache-path %t/module-cache %t/Client.swift -o %t/deps_new_A_rescan.json -I %t/Modules -I %S/../Inputs/CHeaders -module-name Client -serialize-dependency-scan-cache -validate-prior-dependency-scan-cache &> %t/new_A_incremental_scan_output.txt
43
+ // RUN: %target-swift-frontend -scan-dependencies -scanner-module-validation -module-load-mode prefer-interface -Rdependency-scan-cache -load-dependency-scan-cache -dependency-scan-cache-path %t/cache.moddepcache -module-cache-path %t/module-cache %t/Client.swift -o %t/deps_new_A_rescan.json -I %t/Modules -I %t/ExtraCModules -I % S/../Inputs/CHeaders -module-name Client -serialize-dependency-scan-cache -validate-prior-dependency-scan-cache &> %t/new_A_incremental_scan_output.txt
43
44
// RUN: cat %t/new_A_incremental_scan_output.txt | %FileCheck %s -check-prefix=NEW-A-INCREMENTAL-SCAN-CHECK
44
45
// RUN: %validate-json %t/deps_new_A_rescan.json | %FileCheck %s --check-prefix=NEW-A-DEPS-CHECK
45
46
46
- // Touch a header in Clang module X and re-scan
47
- // RUN: touch %S/../Inputs/CHeaders/X .h
48
- // RUN: %target-swift-frontend -scan-dependencies -scanner-module-validation -module-load-mode prefer-interface -Rdependency-scan-cache -load-dependency-scan-cache -dependency-scan-cache-path %t/cache.moddepcache -module-cache-path %t/module-cache %t/Client.swift -o %t/deps_stale_X_rescan .json -I %t/Modules -I %S/../Inputs/CHeaders -module-name Client -serialize-dependency-scan-cache -validate-prior-dependency-scan-cache &> %t/stale_X_incremental_scan_output .txt
49
- // RUN: cat %t/stale_X_incremental_scan_output .txt | %FileCheck %s -check-prefix=STALE-X -INCREMENTAL-SCAN-CHECK
47
+ // Touch a header in Clang module Z and re-scan
48
+ // RUN: touch %t/ExtraCModules/Z .h
49
+ // RUN: %target-swift-frontend -scan-dependencies -scanner-module-validation -module-load-mode prefer-interface -Rdependency-scan-cache -load-dependency-scan-cache -dependency-scan-cache-path %t/cache.moddepcache -module-cache-path %t/module-cache %t/Client.swift -o %t/deps_stale_Z_rescan .json -I %t/Modules -I %t/ExtraCModules -I % S/../Inputs/CHeaders -module-name Client -serialize-dependency-scan-cache -validate-prior-dependency-scan-cache &> %t/stale_Z_incremental_scan_output .txt
50
+ // RUN: cat %t/stale_Z_incremental_scan_output .txt | %FileCheck %s -check-prefix=STALE-Z -INCREMENTAL-SCAN-CHECK
50
51
51
52
// CLEAN-INCREMENTAL-SCAN-CHECK: remark: Incremental module scan: Re-using serialized module scanning dependency cache from: {{.*}}cache.moddepcache
52
53
// CLEAN-INCREMENTAL-SCAN-CHECK: remark: Incremental module scan: Serializing module scanning dependency cache to: {{.*}}cache.moddepcache
63
64
// NEW-A-INCREMENTAL-SCAN-CHECK: remark: Incremental module scan: Dependency info for module 'A' invalidated due to a modified input since last scan: {{.*}}A.swiftmodule{{.*}}swiftinterface
64
65
// NEW-A-DEPS-CHECK: "clang": "X"
65
66
66
- // STALE-X-INCREMENTAL-SCAN-CHECK: remark: Incremental module scan: Re-using serialized module scanning dependency cache from: {{.*}}cache.moddepcache
67
- // STALE-X-INCREMENTAL-SCAN-CHECK: remark: Incremental module scan: Dependency info for module 'X' invalidated due to a modified input since last scan: {{.*}}X.h
68
- // STALE-X-INCREMENTAL-SCAN-CHECK: remark: Incremental module scan: Dependency info for module 'A' invalidated due to an out-of-date dependency.
69
- // STALE-X-INCREMENTAL-SCAN-CHECK: remark: Incremental module scan: Serializing module scanning dependency cache to: {{.*}}cache.moddepcache
67
+ // STALE-Z-INCREMENTAL-SCAN-CHECK: remark: Incremental module scan: Re-using serialized module scanning dependency cache from: {{.*}}cache.moddepcache
68
+ // STALE-Z-INCREMENTAL-SCAN-CHECK: remark: Incremental module scan: Dependency info for module 'Z' invalidated due to a modified input since last scan: {{.*}}Z.h
69
+ // STALE-Z-INCREMENTAL-SCAN-CHECK: remark: Incremental module scan: Serializing module scanning dependency cache to: {{.*}}cache.moddepcache
70
+
71
+ //--- ExtraCModules/Z.h
72
+ void funcZ ( void) ;
73
+
74
+ //--- ExtraCModules/module.modulemap
75
+ module Z {
76
+ header " Z.h "
77
+ export *
78
+ }
70
79
71
80
//--- A.swift
72
81
import B
@@ -82,3 +91,4 @@ public func foo() {}
82
91
83
92
//--- Client.swift
84
93
import A
94
+ import Z
0 commit comments