@@ -583,6 +583,9 @@ final class ExplicitModuleBuildTests: XCTestCase {
583
583
} else if relativeOutputPathFileName. starts ( with: " _SwiftConcurrencyShims- " ) {
584
584
try checkExplicitModuleBuildJob ( job: job, moduleId: . clang( " _SwiftConcurrencyShims " ) ,
585
585
dependencyGraph: dependencyGraph)
586
+ } else if relativeOutputPathFileName. starts ( with: " _Builtin_stdint- " ) {
587
+ try checkExplicitModuleBuildJob ( job: job, moduleId: . clang( " _Builtin_stdint " ) ,
588
+ dependencyGraph: dependencyGraph)
586
589
} else if hostTriple. isMacOSX,
587
590
hostTriple. version ( for: . macOS) < Triple . Version ( 11 , 0 , 0 ) ,
588
591
relativeOutputPathFileName. starts ( with: " X- " ) {
@@ -593,7 +596,8 @@ final class ExplicitModuleBuildTests: XCTestCase {
593
596
}
594
597
} else {
595
598
switch ( outputFilePath) {
596
- case . relative( try . init( validating: " testExplicitModuleBuildJobs " ) ) :
599
+ case . relative( try . init( validating: " testExplicitModuleBuildJobs " ) ) ,
600
+ . relative( try . init( validating: " testExplicitModuleBuildJobs.exe " ) ) :
597
601
XCTAssertTrue ( driver. isExplicitMainModuleJob ( job: job) )
598
602
XCTAssertEqual ( job. kind, . link)
599
603
case . absolute( let path) :
@@ -636,6 +640,7 @@ final class ExplicitModuleBuildTests: XCTestCase {
636
640
. appending ( component: " Swift " )
637
641
let sdkArgumentsForTesting = ( try ? Driver . sdkArgumentsForTesting ( ) ) ?? [ ]
638
642
let invocationArguments = [ " swiftc " ,
643
+ " -Xcc " , " -Xclang " , " -Xcc " , " -fbuiltin-headers-in-system-modules " ,
639
644
" -I " , cHeadersPath. nativePathString ( escaped: true ) ,
640
645
" -I " , swiftModuleInterfacesPath. nativePathString ( escaped: true ) ,
641
646
" -explicit-module-build " ,
@@ -770,12 +775,16 @@ final class ExplicitModuleBuildTests: XCTestCase {
770
775
} else if relativeOutputPathFileName. starts ( with: " _SwiftConcurrencyShims- " ) {
771
776
try checkExplicitModuleBuildJob ( job: job, moduleId: . clang( " _SwiftConcurrencyShims " ) ,
772
777
dependencyGraph: dependencyGraph)
778
+ } else if relativeOutputPathFileName. starts ( with: " _Builtin_stdint- " ) {
779
+ try checkExplicitModuleBuildJob ( job: job, moduleId: . clang( " _Builtin_stdint " ) ,
780
+ dependencyGraph: dependencyGraph)
773
781
} else {
774
782
XCTFail ( " Unexpected module dependency build job output: \( outputFilePath) " )
775
783
}
776
784
} else {
777
785
switch ( outputFilePath) {
778
- case . relative( try . init( validating: " testExplicitModuleVerifyInterfaceJobs " ) ) :
786
+ case . relative( try . init( validating: " testExplicitModuleVerifyInterfaceJobs " ) ) ,
787
+ . relative( try . init( validating: " testExplicitModuleVerifyInterfaceJobs.exe " ) ) :
779
788
XCTAssertTrue ( driver. isExplicitMainModuleJob ( job: job) )
780
789
XCTAssertEqual ( job. kind, . link)
781
790
case . absolute( let path) :
@@ -893,6 +902,9 @@ final class ExplicitModuleBuildTests: XCTestCase {
893
902
} else if relativeOutputPathFileName. starts ( with: " _SwiftConcurrencyShims- " ) {
894
903
try checkExplicitModuleBuildJob ( job: job, moduleId: . clang( " _SwiftConcurrencyShims " ) ,
895
904
dependencyGraph: dependencyGraph)
905
+ } else if relativeOutputPathFileName. starts ( with: " _Builtin_stdint- " ) {
906
+ try checkExplicitModuleBuildJob ( job: job, moduleId: . clang( " _Builtin_stdint " ) ,
907
+ dependencyGraph: dependencyGraph)
896
908
} else {
897
909
XCTFail ( " Unexpected module dependency build job output: \( outputFilePath) " )
898
910
}
@@ -910,7 +922,8 @@ final class ExplicitModuleBuildTests: XCTestCase {
910
922
// Check we don't use `-pch-output-dir` anymore during main module job.
911
923
XCTAssertFalse ( job. commandLine. contains ( " -pch-output-dir " ) )
912
924
switch ( outputFilePath) {
913
- case . relative( try . init( validating: " testExplicitModuleBuildPCHOutputJobs " ) ) :
925
+ case . relative( try . init( validating: " testExplicitModuleBuildPCHOutputJobs " ) ) ,
926
+ . relative( try . init( validating: " testExplicitModuleBuildPCHOutputJobs.exe " ) ) :
914
927
XCTAssertTrue ( driver. isExplicitMainModuleJob ( job: job) )
915
928
XCTAssertEqual ( job. kind, . link)
916
929
case . absolute( let path) :
@@ -1009,6 +1022,9 @@ final class ExplicitModuleBuildTests: XCTestCase {
1009
1022
} else if relativeOutputPathFileName. starts ( with: " _SwiftConcurrencyShims- " ) {
1010
1023
try checkExplicitModuleBuildJob ( job: job, moduleId: . clang( " _SwiftConcurrencyShims " ) ,
1011
1024
dependencyGraph: dependencyGraph)
1025
+ } else if relativeOutputPathFileName. starts ( with: " _Builtin_stdint- " ) {
1026
+ try checkExplicitModuleBuildJob ( job: job, moduleId: . clang( " _Builtin_stdint " ) ,
1027
+ dependencyGraph: dependencyGraph)
1012
1028
} else {
1013
1029
XCTFail ( " Unexpected module dependency build job output: \( outputFilePath) " )
1014
1030
}
@@ -1044,12 +1060,11 @@ final class ExplicitModuleBuildTests: XCTestCase {
1044
1060
1045
1061
// Create Bar.swiftmodule
1046
1062
var driver = try Driver ( args: [ " swiftc " ,
1063
+ " -Xcc " , " -Xclang " , " -Xcc " , " -fbuiltin-headers-in-system-modules " ,
1047
1064
" -explicit-module-build " ,
1048
- " -working-directory " ,
1049
- path. nativePathString ( escaped: true ) ,
1065
+ " -working-directory " , path. nativePathString ( escaped: true ) ,
1050
1066
srcBar. nativePathString ( escaped: true ) ,
1051
- " -module-name " ,
1052
- " Bar " ,
1067
+ " -module-name " , " Bar " ,
1053
1068
" -emit-module " ,
1054
1069
" -emit-module-path " , moduleBarPath,
1055
1070
" -module-cache-path " , path. nativePathString ( escaped: true ) ,
@@ -1271,6 +1286,7 @@ final class ExplicitModuleBuildTests: XCTestCase {
1271
1286
let ( stdLibPath, shimsPath, _, _) = try getDriverArtifactsForScanning ( )
1272
1287
1273
1288
var driver1 = try Driver ( args: [ " swiftc " ,
1289
+ " -Xcc " , " -Xclang " , " -Xcc " , " -fbuiltin-headers-in-system-modules " ,
1274
1290
" -explicit-module-build " ,
1275
1291
" -module-name " , " Bar " ,
1276
1292
" -working-directory " , path. nativePathString ( escaped: true ) ,
@@ -1305,6 +1321,7 @@ final class ExplicitModuleBuildTests: XCTestCase {
1305
1321
"""
1306
1322
)
1307
1323
var driver2 = try Driver ( args: [ " swiftc " ,
1324
+ " -Xcc " , " -Xclang " , " -Xcc " , " -fbuiltin-headers-in-system-modules " ,
1308
1325
" -I " , path. nativePathString ( escaped: true ) ,
1309
1326
" -explicit-module-build " ,
1310
1327
" -module-name " , " Foo " ,
@@ -1347,6 +1364,7 @@ final class ExplicitModuleBuildTests: XCTestCase {
1347
1364
. appending ( component: " Swift " )
1348
1365
let sdkArgumentsForTesting = ( try ? Driver . sdkArgumentsForTesting ( ) ) ?? [ ]
1349
1366
var driver = try Driver ( args: [ " swiftc " ,
1367
+ " -Xcc " , " -Xclang " , " -Xcc " , " -fbuiltin-headers-in-system-modules " ,
1350
1368
" -I " , cHeadersPath. nativePathString ( escaped: true ) ,
1351
1369
" -I " , swiftModuleInterfacesPath. nativePathString ( escaped: true ) ,
1352
1370
" -explicit-module-build " ,
@@ -1522,7 +1540,7 @@ final class ExplicitModuleBuildTests: XCTestCase {
1522
1540
var driver = try Driver ( args: [ " swiftc " ,
1523
1541
" -explicit-module-build " ,
1524
1542
" -clang-scanner-module-cache-path " ,
1525
- scannerCachePath. nativePathString ( escaped: true ) ,
1543
+ scannerCachePath. nativePathString ( escaped: false ) ,
1526
1544
" -module-cache-path " ,
1527
1545
moduleCachePath. nativePathString ( escaped: true ) ,
1528
1546
" -working-directory " , path. nativePathString ( escaped: true ) ,
@@ -1759,7 +1777,7 @@ final class ExplicitModuleBuildTests: XCTestCase {
1759
1777
hostTriple. version ( for: . macOS) < Triple . Version ( 11 , 0 , 0 ) {
1760
1778
expectedNumberOfDependencies = 13
1761
1779
} else if driver. targetTriple. isWindows {
1762
- expectedNumberOfDependencies = 15
1780
+ expectedNumberOfDependencies = 13
1763
1781
} else {
1764
1782
expectedNumberOfDependencies = 12
1765
1783
}
@@ -1816,6 +1834,8 @@ final class ExplicitModuleBuildTests: XCTestCase {
1816
1834
// Ensure dependency scanning succeeds via fallback `swift-frontend -scan-dependenceis`
1817
1835
// mechanism if libSwiftScan.dylib fails to load.
1818
1836
func testDependencyScanningFallback( ) throws {
1837
+ try XCTSkipIf ( true , " skipping until CAS is supported on all platforms " )
1838
+
1819
1839
let ( stdlibPath, shimsPath, _, _) = try getDriverArtifactsForScanning ( )
1820
1840
1821
1841
// Create a simple test case.
@@ -2126,24 +2146,25 @@ final class ExplicitModuleBuildTests: XCTestCase {
2126
2146
2127
2147
func testDependencyScanCommandLineEscape( ) throws {
2128
2148
#if os(Windows)
2129
- let quoteCharacter : Character = " \" "
2149
+ let quote : Character = " \" "
2130
2150
#else
2131
- let quoteCharacter : Character = " ' "
2151
+ let quote : Character = " ' "
2132
2152
#endif
2133
- let swiftInputWithSpace = " /tmp/input example/test.swift "
2134
- let swiftInputWithoutSpace = " /tmp/baz.swift "
2135
- let clangInputWithSpace = " /tmp/input example/bar.o "
2153
+ let input1 = try AbsolutePath ( validating : " /tmp/input example/test.swift " )
2154
+ let input2 = try AbsolutePath ( validating : " /tmp/baz.swift " )
2155
+ let input3 = try AbsolutePath ( validating : " /tmp/input example/bar.o " )
2136
2156
var driver = try Driver ( args: [ " swiftc " , " -explicit-module-build " ,
2137
2157
" -module-name " , " testDependencyScanning " ,
2138
- swiftInputWithSpace, swiftInputWithoutSpace,
2139
- " -Xcc " , clangInputWithSpace] )
2158
+ input1. nativePathString ( escaped: false ) ,
2159
+ input2. nativePathString ( escaped: false ) ,
2160
+ " -Xcc " , input3. nativePathString ( escaped: false ) ] )
2140
2161
let scanJob = try driver. dependencyScanningJob ( )
2141
2162
let scanJobCommand = try Driver . itemizedJobCommand ( of: scanJob,
2142
2163
useResponseFiles: . disabled,
2143
2164
using: ArgsResolver ( fileSystem: InMemoryFileSystem ( ) ) )
2144
- XCTAssertTrue ( scanJobCommand. contains ( String ( quoteCharacter ) + swiftInputWithSpace + String ( quoteCharacter ) ) )
2145
- XCTAssertTrue ( scanJobCommand. contains ( String ( quoteCharacter ) + clangInputWithSpace + String ( quoteCharacter ) ) )
2146
- XCTAssertTrue ( scanJobCommand. contains ( swiftInputWithoutSpace ) )
2165
+ XCTAssertTrue ( scanJobCommand. contains ( " \( quote ) \( input1 . nativePathString ( escaped : false ) ) \( quote ) " ) )
2166
+ XCTAssertTrue ( scanJobCommand. contains ( " \( quote ) \( input3 . nativePathString ( escaped : false ) ) \( quote ) " ) )
2167
+ XCTAssertTrue ( scanJobCommand. contains ( input2 . nativePathString ( escaped : false ) ) )
2147
2168
}
2148
2169
2149
2170
func testDependencyGraphTransitiveClosure( ) throws {
@@ -2218,6 +2239,7 @@ final class ExplicitModuleBuildTests: XCTestCase {
2218
2239
do {
2219
2240
try assertDriverDiagnostics ( args: [
2220
2241
" swiftc " ,
2242
+ " -Xcc " , " -Xclang " , " -Xcc " , " -fbuiltin-headers-in-system-modules " ,
2221
2243
" -I " , cHeadersPath. nativePathString ( escaped: true ) ,
2222
2244
" -I " , swiftModuleInterfacesPath. nativePathString ( escaped: true ) ,
2223
2245
" -explicit-module-build " ,
@@ -2241,6 +2263,7 @@ final class ExplicitModuleBuildTests: XCTestCase {
2241
2263
do {
2242
2264
try assertDriverDiagnostics ( args: [
2243
2265
" swiftc " ,
2266
+ " -Xcc " , " -Xclang " , " -Xcc " , " -fbuiltin-headers-in-system-modules " ,
2244
2267
" -I " , cHeadersPath. nativePathString ( escaped: true ) ,
2245
2268
" -I " , swiftModuleInterfacesPath. nativePathString ( escaped: true ) ,
2246
2269
" -explicit-module-build " ,
@@ -2286,6 +2309,7 @@ final class ExplicitModuleBuildTests: XCTestCase {
2286
2309
let outputModule = path. appending ( component: " Test.swiftmodule " )
2287
2310
let sdkArgumentsForTesting = ( try ? Driver . sdkArgumentsForTesting ( ) ) ?? [ ]
2288
2311
var driver = try Driver ( args: [ " swiftc " ,
2312
+ " -Xcc " , " -Xclang " , " -Xcc " , " -fbuiltin-headers-in-system-modules " ,
2289
2313
" -explicit-module-build " , " -module-name " , " Test " ,
2290
2314
" -module-cache-path " , moduleCachePath. nativePathString ( escaped: true ) ,
2291
2315
" -working-directory " , path. nativePathString ( escaped: true ) ,
0 commit comments