@@ -583,6 +583,9 @@ final class ExplicitModuleBuildTests: XCTestCase {
583583 } else if relativeOutputPathFileName. starts ( with: " _SwiftConcurrencyShims- " ) {
584584 try checkExplicitModuleBuildJob ( job: job, moduleId: . clang( " _SwiftConcurrencyShims " ) ,
585585 dependencyGraph: dependencyGraph)
586+ } else if relativeOutputPathFileName. starts ( with: " _Builtin_stdint- " ) {
587+ try checkExplicitModuleBuildJob ( job: job, moduleId: . clang( " _Builtin_stdint " ) ,
588+ dependencyGraph: dependencyGraph)
586589 } else if hostTriple. isMacOSX,
587590 hostTriple. version ( for: . macOS) < Triple . Version ( 11 , 0 , 0 ) ,
588591 relativeOutputPathFileName. starts ( with: " X- " ) {
@@ -593,7 +596,8 @@ final class ExplicitModuleBuildTests: XCTestCase {
593596 }
594597 } else {
595598 switch ( outputFilePath) {
596- case . relative( try . init( validating: " testExplicitModuleBuildJobs " ) ) :
599+ case . relative( try . init( validating: " testExplicitModuleBuildJobs " ) ) ,
600+ . relative( try . init( validating: " testExplicitModuleBuildJobs.exe " ) ) :
597601 XCTAssertTrue ( driver. isExplicitMainModuleJob ( job: job) )
598602 XCTAssertEqual ( job. kind, . link)
599603 case . absolute( let path) :
@@ -636,6 +640,7 @@ final class ExplicitModuleBuildTests: XCTestCase {
636640 . appending ( component: " Swift " )
637641 let sdkArgumentsForTesting = ( try ? Driver . sdkArgumentsForTesting ( ) ) ?? [ ]
638642 let invocationArguments = [ " swiftc " ,
643+ " -Xcc " , " -Xclang " , " -Xcc " , " -fbuiltin-headers-in-system-modules " ,
639644 " -I " , cHeadersPath. nativePathString ( escaped: true ) ,
640645 " -I " , swiftModuleInterfacesPath. nativePathString ( escaped: true ) ,
641646 " -explicit-module-build " ,
@@ -770,12 +775,16 @@ final class ExplicitModuleBuildTests: XCTestCase {
770775 } else if relativeOutputPathFileName. starts ( with: " _SwiftConcurrencyShims- " ) {
771776 try checkExplicitModuleBuildJob ( job: job, moduleId: . clang( " _SwiftConcurrencyShims " ) ,
772777 dependencyGraph: dependencyGraph)
778+ } else if relativeOutputPathFileName. starts ( with: " _Builtin_stdint- " ) {
779+ try checkExplicitModuleBuildJob ( job: job, moduleId: . clang( " _Builtin_stdint " ) ,
780+ dependencyGraph: dependencyGraph)
773781 } else {
774782 XCTFail ( " Unexpected module dependency build job output: \( outputFilePath) " )
775783 }
776784 } else {
777785 switch ( outputFilePath) {
778- case . relative( try . init( validating: " testExplicitModuleVerifyInterfaceJobs " ) ) :
786+ case . relative( try . init( validating: " testExplicitModuleVerifyInterfaceJobs " ) ) ,
787+ . relative( try . init( validating: " testExplicitModuleVerifyInterfaceJobs.exe " ) ) :
779788 XCTAssertTrue ( driver. isExplicitMainModuleJob ( job: job) )
780789 XCTAssertEqual ( job. kind, . link)
781790 case . absolute( let path) :
@@ -893,6 +902,9 @@ final class ExplicitModuleBuildTests: XCTestCase {
893902 } else if relativeOutputPathFileName. starts ( with: " _SwiftConcurrencyShims- " ) {
894903 try checkExplicitModuleBuildJob ( job: job, moduleId: . clang( " _SwiftConcurrencyShims " ) ,
895904 dependencyGraph: dependencyGraph)
905+ } else if relativeOutputPathFileName. starts ( with: " _Builtin_stdint- " ) {
906+ try checkExplicitModuleBuildJob ( job: job, moduleId: . clang( " _Builtin_stdint " ) ,
907+ dependencyGraph: dependencyGraph)
896908 } else {
897909 XCTFail ( " Unexpected module dependency build job output: \( outputFilePath) " )
898910 }
@@ -910,7 +922,8 @@ final class ExplicitModuleBuildTests: XCTestCase {
910922 // Check we don't use `-pch-output-dir` anymore during main module job.
911923 XCTAssertFalse ( job. commandLine. contains ( " -pch-output-dir " ) )
912924 switch ( outputFilePath) {
913- case . relative( try . init( validating: " testExplicitModuleBuildPCHOutputJobs " ) ) :
925+ case . relative( try . init( validating: " testExplicitModuleBuildPCHOutputJobs " ) ) ,
926+ . relative( try . init( validating: " testExplicitModuleBuildPCHOutputJobs.exe " ) ) :
914927 XCTAssertTrue ( driver. isExplicitMainModuleJob ( job: job) )
915928 XCTAssertEqual ( job. kind, . link)
916929 case . absolute( let path) :
@@ -1009,6 +1022,9 @@ final class ExplicitModuleBuildTests: XCTestCase {
10091022 } else if relativeOutputPathFileName. starts ( with: " _SwiftConcurrencyShims- " ) {
10101023 try checkExplicitModuleBuildJob ( job: job, moduleId: . clang( " _SwiftConcurrencyShims " ) ,
10111024 dependencyGraph: dependencyGraph)
1025+ } else if relativeOutputPathFileName. starts ( with: " _Builtin_stdint- " ) {
1026+ try checkExplicitModuleBuildJob ( job: job, moduleId: . clang( " _Builtin_stdint " ) ,
1027+ dependencyGraph: dependencyGraph)
10121028 } else {
10131029 XCTFail ( " Unexpected module dependency build job output: \( outputFilePath) " )
10141030 }
@@ -1044,12 +1060,11 @@ final class ExplicitModuleBuildTests: XCTestCase {
10441060
10451061 // Create Bar.swiftmodule
10461062 var driver = try Driver ( args: [ " swiftc " ,
1063+ " -Xcc " , " -Xclang " , " -Xcc " , " -fbuiltin-headers-in-system-modules " ,
10471064 " -explicit-module-build " ,
1048- " -working-directory " ,
1049- path. nativePathString ( escaped: true ) ,
1065+ " -working-directory " , path. nativePathString ( escaped: true ) ,
10501066 srcBar. nativePathString ( escaped: true ) ,
1051- " -module-name " ,
1052- " Bar " ,
1067+ " -module-name " , " Bar " ,
10531068 " -emit-module " ,
10541069 " -emit-module-path " , moduleBarPath,
10551070 " -module-cache-path " , path. nativePathString ( escaped: true ) ,
@@ -1271,6 +1286,7 @@ final class ExplicitModuleBuildTests: XCTestCase {
12711286 let ( stdLibPath, shimsPath, _, _) = try getDriverArtifactsForScanning ( )
12721287
12731288 var driver1 = try Driver ( args: [ " swiftc " ,
1289+ " -Xcc " , " -Xclang " , " -Xcc " , " -fbuiltin-headers-in-system-modules " ,
12741290 " -explicit-module-build " ,
12751291 " -module-name " , " Bar " ,
12761292 " -working-directory " , path. nativePathString ( escaped: true ) ,
@@ -1305,6 +1321,7 @@ final class ExplicitModuleBuildTests: XCTestCase {
13051321 """
13061322 )
13071323 var driver2 = try Driver ( args: [ " swiftc " ,
1324+ " -Xcc " , " -Xclang " , " -Xcc " , " -fbuiltin-headers-in-system-modules " ,
13081325 " -I " , path. nativePathString ( escaped: true ) ,
13091326 " -explicit-module-build " ,
13101327 " -module-name " , " Foo " ,
@@ -1347,6 +1364,7 @@ final class ExplicitModuleBuildTests: XCTestCase {
13471364 . appending ( component: " Swift " )
13481365 let sdkArgumentsForTesting = ( try ? Driver . sdkArgumentsForTesting ( ) ) ?? [ ]
13491366 var driver = try Driver ( args: [ " swiftc " ,
1367+ " -Xcc " , " -Xclang " , " -Xcc " , " -fbuiltin-headers-in-system-modules " ,
13501368 " -I " , cHeadersPath. nativePathString ( escaped: true ) ,
13511369 " -I " , swiftModuleInterfacesPath. nativePathString ( escaped: true ) ,
13521370 " -explicit-module-build " ,
@@ -1522,7 +1540,7 @@ final class ExplicitModuleBuildTests: XCTestCase {
15221540 var driver = try Driver ( args: [ " swiftc " ,
15231541 " -explicit-module-build " ,
15241542 " -clang-scanner-module-cache-path " ,
1525- scannerCachePath. nativePathString ( escaped: true ) ,
1543+ scannerCachePath. nativePathString ( escaped: false ) ,
15261544 " -module-cache-path " ,
15271545 moduleCachePath. nativePathString ( escaped: true ) ,
15281546 " -working-directory " , path. nativePathString ( escaped: true ) ,
@@ -1759,7 +1777,7 @@ final class ExplicitModuleBuildTests: XCTestCase {
17591777 hostTriple. version ( for: . macOS) < Triple . Version ( 11 , 0 , 0 ) {
17601778 expectedNumberOfDependencies = 13
17611779 } else if driver. targetTriple. isWindows {
1762- expectedNumberOfDependencies = 15
1780+ expectedNumberOfDependencies = 13
17631781 } else {
17641782 expectedNumberOfDependencies = 12
17651783 }
@@ -1816,6 +1834,8 @@ final class ExplicitModuleBuildTests: XCTestCase {
18161834 // Ensure dependency scanning succeeds via fallback `swift-frontend -scan-dependenceis`
18171835 // mechanism if libSwiftScan.dylib fails to load.
18181836 func testDependencyScanningFallback( ) throws {
1837+ try XCTSkipIf ( true , " skipping until CAS is supported on all platforms " )
1838+
18191839 let ( stdlibPath, shimsPath, _, _) = try getDriverArtifactsForScanning ( )
18201840
18211841 // Create a simple test case.
@@ -2126,24 +2146,25 @@ final class ExplicitModuleBuildTests: XCTestCase {
21262146
21272147 func testDependencyScanCommandLineEscape( ) throws {
21282148#if os(Windows)
2129- let quoteCharacter : Character = " \" "
2149+ let quote : Character = " \" "
21302150#else
2131- let quoteCharacter : Character = " ' "
2151+ let quote : Character = " ' "
21322152#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 " )
21362156 var driver = try Driver ( args: [ " swiftc " , " -explicit-module-build " ,
21372157 " -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 ) ] )
21402161 let scanJob = try driver. dependencyScanningJob ( )
21412162 let scanJobCommand = try Driver . itemizedJobCommand ( of: scanJob,
21422163 useResponseFiles: . disabled,
21432164 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 ) ) )
21472168 }
21482169
21492170 func testDependencyGraphTransitiveClosure( ) throws {
@@ -2218,6 +2239,7 @@ final class ExplicitModuleBuildTests: XCTestCase {
22182239 do {
22192240 try assertDriverDiagnostics ( args: [
22202241 " swiftc " ,
2242+ " -Xcc " , " -Xclang " , " -Xcc " , " -fbuiltin-headers-in-system-modules " ,
22212243 " -I " , cHeadersPath. nativePathString ( escaped: true ) ,
22222244 " -I " , swiftModuleInterfacesPath. nativePathString ( escaped: true ) ,
22232245 " -explicit-module-build " ,
@@ -2241,6 +2263,7 @@ final class ExplicitModuleBuildTests: XCTestCase {
22412263 do {
22422264 try assertDriverDiagnostics ( args: [
22432265 " swiftc " ,
2266+ " -Xcc " , " -Xclang " , " -Xcc " , " -fbuiltin-headers-in-system-modules " ,
22442267 " -I " , cHeadersPath. nativePathString ( escaped: true ) ,
22452268 " -I " , swiftModuleInterfacesPath. nativePathString ( escaped: true ) ,
22462269 " -explicit-module-build " ,
@@ -2286,6 +2309,7 @@ final class ExplicitModuleBuildTests: XCTestCase {
22862309 let outputModule = path. appending ( component: " Test.swiftmodule " )
22872310 let sdkArgumentsForTesting = ( try ? Driver . sdkArgumentsForTesting ( ) ) ?? [ ]
22882311 var driver = try Driver ( args: [ " swiftc " ,
2312+ " -Xcc " , " -Xclang " , " -Xcc " , " -fbuiltin-headers-in-system-modules " ,
22892313 " -explicit-module-build " , " -module-name " , " Test " ,
22902314 " -module-cache-path " , moduleCachePath. nativePathString ( escaped: true ) ,
22912315 " -working-directory " , path. nativePathString ( escaped: true ) ,
0 commit comments