2
2
// RUN: %empty-directory(%t)
3
3
// RUN: %empty-directory(%t/module-cache)
4
4
// RUN: %empty-directory(%t/inputs)
5
+ // RUN: %empty-directory(%t/inputs-2)
5
6
// RUN: split-file %s %t
6
7
7
8
// RUN: sed -e "s|OUT_DIR|%t/redirects|g" -e "s|IN_DIR|%t/inputs|g" %t/overlay_template.yaml > %t/overlay.yaml
9
+ // RUN: sed -e "s|OUT_DIR|%t/redirects-2|g" -e "s|IN_DIR|%t/inputs-2|g" %t/overlay_template_2.yaml > %t/overlay-2.yaml
8
10
9
- // RUN: %target-swift-frontend -scan-dependencies -module-load-mode prefer-serialized -module-cache-path %t/module-cache %t/test.swift -o %t/deps.json -I %t/inputs -I %S/Inputs/Swift -disable-implicit-concurrency-module-import -disable-implicit-string-processing-module-import -Xcc -ivfsoverlay -Xcc %t/overlay.yaml
11
+ /// Put some files in RealFileSystem that need to be over shadow by VFS.
12
+ // RUN: touch %t/inputs/module.modulemap
13
+ // RUN: touch %t/inputs-2/module.modulemap
14
+
15
+ // RUN: %target-swift-frontend -scan-dependencies -module-load-mode prefer-serialized -module-cache-path %t/module-cache %t/test.swift -o %t/deps.json -I %t/inputs -I %t/inputs-2 -I %S/Inputs/Swift -disable-implicit-concurrency-module-import -disable-implicit-string-processing-module-import -Xcc -ivfsoverlay -Xcc %t/overlay.yaml -Xcc -ivfsoverlay -Xcc %t/overlay-2.yaml
10
16
// RUN: %validate-json %t/deps.json | %FileCheck %s
11
17
12
18
// RUN: %{python} %S/../CAS/Inputs/BuildCommandExtractor.py %t/deps.json clang:SwiftShims > %t/shim.cmd
15
21
// RUN: %swift_frontend_plain @%t/swift.cmd
16
22
// RUN: %{python} %S/../CAS/Inputs/BuildCommandExtractor.py %t/deps.json SwiftOnoneSupport > %t/onone.cmd
17
23
// RUN: %swift_frontend_plain @%t/onone.cmd
24
+ // RUN: %{python} %S/../CAS/Inputs/BuildCommandExtractor.py %t/deps.json clang:Indirect > %t/Indirect.cmd
25
+ // RUN: %swift_frontend_plain @%t/Indirect.cmd
18
26
// RUN: %{python} %S/../CAS/Inputs/BuildCommandExtractor.py %t/deps.json clang:F > %t/F.cmd
19
27
// RUN: %swift_frontend_plain @%t/F.cmd
20
28
// RUN: %{python} %S/../CAS/Inputs/BuildCommandExtractor.py %t/deps.json F > %t/SwiftF.cmd
28
36
// RUN: echo "\"-explicit-swift-module-map-file\"" >> %t/MyApp.cmd
29
37
// RUN: echo "\"%t/map.json\"" >> %t/MyApp.cmd
30
38
31
- // RUN: %target-swift-frontend @%t/MyApp.cmd %t/test.swift -Xcc -ivfsoverlay -Xcc %t/overlay.yaml \
39
+ // RUN: %target-swift-frontend @%t/MyApp.cmd %t/test.swift -Xcc -ivfsoverlay -Xcc %t/overlay.yaml -Xcc -ivfsoverlay -Xcc %t/overlay-2.yaml \
32
40
// RUN: -emit-module -o %t/Test.swiftmodule
33
41
34
42
//--- redirects/RedirectedF.h
43
+ #include " Indirect_2.h "
35
44
void funcRedirectedF ( void) ;
36
45
37
46
//--- redirects/modulemap
@@ -40,6 +49,15 @@ module F {
40
49
export *
41
50
}
42
51
52
+ //--- redirects-2/RedirectedIndirect.h
53
+ void funcRedirectedIndirect ( void) ;
54
+
55
+ //--- redirects-2/modulemap
56
+ module Indirect {
57
+ header " Indirect_2.h "
58
+ export *
59
+ }
60
+
43
61
//--- overlay_template.yaml
44
62
{
45
63
'version': 0 ,
@@ -59,10 +77,30 @@ module F {
59
77
]
60
78
}
61
79
80
+ //--- overlay_template_2.yaml
81
+ {
82
+ 'version': 0 ,
83
+ 'use- external- names': false ,
84
+ 'roots': [
85
+ {
86
+ 'name': 'IN_DIR', 'type': 'directory',
87
+ 'contents': [
88
+ { 'name': 'Indirect_2 . h', 'type': 'file',
89
+ 'external- contents': 'OUT_DIR/ RedirectedIndirect. h'
90
+ } ,
91
+ { 'name': 'module. modulemap', 'type': 'file',
92
+ 'external- contents': 'OUT_DIR/ modulemap'
93
+ }
94
+ ]
95
+ } ,
96
+ ]
97
+ }
98
+
62
99
//--- test.swift
63
100
import F
64
101
65
102
func testF( ) { funcRedirectedF ( ) }
103
+ func testIndirect( ) { funcRedirectedIndirect ( ) }
66
104
67
105
// CHECK: "mainModuleName": "deps"
68
106
/// --------Main module
@@ -94,11 +132,33 @@ func testF() { funcRedirectedF() }
94
132
// CHECK: "-ivfsoverlay",
95
133
// CHECK-NEXT: "-Xcc",
96
134
// CHECK-NEXT: "{{.*}}{{/|\\}}preserve_used_vfs.swift.tmp{{/|\\}}overlay.yaml",
135
+ // CHECK-NEXT: "-Xcc",
136
+ // CHECK-NEXT: "-ivfsoverlay",
137
+ // CHECK-NEXT: "-Xcc",
138
+ // CHECK-NEXT: "{{.*}}{{/|\\}}preserve_used_vfs.swift.tmp{{/|\\}}overlay-2.yaml",
97
139
// CHECK: ],
98
140
99
141
/// --------Clang module F
100
142
// CHECK-LABEL: "modulePath": "{{.*}}{{/|\\}}F-{{.*}}.pcm",
101
143
// CHECK: "commandLine": [
102
144
// CHECK: "-vfsoverlay",
103
145
// CHECK-NEXT: "{{.*}}{{/|\\}}preserve_used_vfs.swift.tmp{{/|\\}}overlay.yaml",
104
- // CHECK: ],
146
+ // CHECK-NEXT: "-vfsoverlay",
147
+ // CHECK-NEXT: "{{.*}}{{/|\\}}preserve_used_vfs.swift.tmp{{/|\\}}overlay-2.yaml",
148
+ // CHECK: "-ivfsoverlay",
149
+ // CHECK-NEXT: "-Xcc",
150
+ // CHECK-NEXT: "{{.*}}{{/|\\}}preserve_used_vfs.swift.tmp{{/|\\}}overlay.yaml",
151
+ // CHECK-NEXT: "-Xcc",
152
+ // CHECK-NEXT: "-ivfsoverlay",
153
+ // CHECK-NEXT: "-Xcc",
154
+ // CHECK-NEXT: "{{.*}}{{/|\\}}preserve_used_vfs.swift.tmp{{/|\\}}overlay-2.yaml",
155
+ // CHECK: ]
156
+
157
+ /// --------Clang module Indirect
158
+ // CHECK-LABEL: "modulePath": "{{.*}}{{/|\\}}Indirect-{{.*}}.pcm",
159
+ // CHECK-NOT: overlay.yaml
160
+ // CHECK: "-vfsoverlay",
161
+ // CHECK-NEXT: "{{.*}}{{/|\\}}preserve_used_vfs.swift.tmp{{/|\\}}overlay-2.yaml",
162
+ // CHECK: "-ivfsoverlay",
163
+ // CHECK-NEXT: "-Xcc",
164
+ // CHECK-NEXT: "{{.*}}{{/|\\}}preserve_used_vfs.swift.tmp{{/|\\}}overlay-2.yaml",
0 commit comments