@@ -754,12 +754,6 @@ final class ExplicitModuleBuildTests: XCTestCase {
754754// We only care about prebuilt modules in macOS.
755755#if os(macOS)
756756 func testPrebuiltModuleGenerationJobs( ) throws {
757- #if arch(arm64)
758- // Disabled on Apple Silicon
759- // rdar://76609781
760- throw XCTSkip ( )
761- #endif
762-
763757 func getInputModules( _ job: Job ) -> [ String ] {
764758 return job. inputs. map { input in
765759 return input. file. absolutePath!. parentDirectory. basenameWithoutExt
@@ -791,7 +785,6 @@ final class ExplicitModuleBuildTests: XCTestCase {
791785 job. outputs [ 0 ] . file. basenameWithoutExt == basenameWithoutExt
792786 }
793787 }
794-
795788 let packageRootPath = URL ( fileURLWithPath: #file) . pathComponents
796789 . prefix ( while: { $0 != " Tests " } ) . joined ( separator: " / " ) . dropFirst ( )
797790 let testInputsPath = packageRootPath + " /TestInputs "
@@ -801,12 +794,12 @@ final class ExplicitModuleBuildTests: XCTestCase {
801794 let interfaceMap = try collector. collectSwiftInterfaceMap ( )
802795
803796 // Check interface map always contain everything
804- XCTAssertTrue ( interfaceMap [ " Swift " ] !. count == 2 )
805- XCTAssertTrue ( interfaceMap [ " A " ] !. count == 2 )
806- XCTAssertTrue ( interfaceMap [ " E " ] !. count == 2 )
797+ XCTAssertTrue ( interfaceMap [ " Swift " ] !. count == 3 )
798+ XCTAssertTrue ( interfaceMap [ " A " ] !. count == 3 )
799+ XCTAssertTrue ( interfaceMap [ " E " ] !. count == 3 )
807800 XCTAssertTrue ( interfaceMap [ " F " ] !. count == 3 )
808- XCTAssertTrue ( interfaceMap [ " G " ] !. count == 2 )
809- XCTAssertTrue ( interfaceMap [ " H " ] !. count == 2 )
801+ XCTAssertTrue ( interfaceMap [ " G " ] !. count == 3 )
802+ XCTAssertTrue ( interfaceMap [ " H " ] !. count == 3 )
810803
811804 try withTemporaryDirectory { path in
812805 let main = path. appending ( component: " testPrebuiltModuleGenerationJobs.swift " )
@@ -823,7 +816,6 @@ final class ExplicitModuleBuildTests: XCTestCase {
823816 " -sdk " , mockSDKPath,
824817 " -module-cache-path " , moduleCachePath
825818 ] )
826-
827819 let ( jobs, danglingJobs) = try driver. generatePrebuitModuleGenerationJobs ( with: interfaceMap,
828820 into: VirtualPath ( path: " /tmp/ " ) . absolutePath!,
829821 exhaustive: true )
@@ -832,24 +824,32 @@ final class ExplicitModuleBuildTests: XCTestCase {
832824 XCTAssertTrue ( danglingJobs. allSatisfy { job in
833825 job. moduleName == " MissingKit "
834826 } )
835- XCTAssertTrue ( jobs. count == 13 )
827+ XCTAssertTrue ( jobs. count == 18 )
836828 XCTAssertTrue ( jobs. allSatisfy { $0. outputs. count == 1 } )
837829 XCTAssertTrue ( jobs. allSatisfy { $0. kind == . compile} )
838830 XCTAssertTrue ( jobs. allSatisfy { $0. commandLine. contains ( . flag( " -compile-module-from-interface " ) ) } )
839831 XCTAssertTrue ( jobs. allSatisfy { $0. commandLine. contains ( . flag( " -module-cache-path " ) ) } )
840832 XCTAssertTrue ( try jobs. allSatisfy { $0. commandLine. contains ( . path( try VirtualPath ( path: moduleCachePath) ) ) } )
841833 let HJobs = jobs. filter { $0. moduleName == " H " }
842- XCTAssertTrue ( HJobs . count == 2 )
843- XCTAssertTrue ( getInputModules ( HJobs [ 0 ] ) == [ " A " , " E " , " F " , " G " , " Swift " ] )
834+ XCTAssertTrue ( HJobs . count == 3 )
835+ // arm64
836+ XCTAssertTrue ( getInputModules ( HJobs [ 0 ] ) == [ " A " , " A " , " E " , " E " , " F " , " F " , " G " , " G " , " Swift " , " Swift " ] )
837+ // arm64e
844838 XCTAssertTrue ( getInputModules ( HJobs [ 1 ] ) == [ " A " , " E " , " F " , " G " , " Swift " ] )
839+ // x86_64
840+ XCTAssertTrue ( getInputModules ( HJobs [ 2 ] ) == [ " A " , " E " , " F " , " G " , " Swift " ] )
845841 XCTAssertTrue ( getOutputName ( HJobs [ 0 ] ) != getOutputName ( HJobs [ 1 ] ) )
842+ XCTAssertTrue ( getOutputName ( HJobs [ 1 ] ) != getOutputName ( HJobs [ 2 ] ) )
846843 checkInputOutputIntegrity ( HJobs [ 0 ] )
847844 checkInputOutputIntegrity ( HJobs [ 1 ] )
845+ checkInputOutputIntegrity ( HJobs [ 2 ] )
848846 let GJobs = jobs. filter { $0. moduleName == " G " }
849- XCTAssertTrue ( GJobs . count == 2 )
850- XCTAssertTrue ( getInputModules ( GJobs [ 0 ] ) == [ " E " , " Swift " ] )
847+ XCTAssertTrue ( GJobs . count == 3 )
848+ XCTAssertTrue ( getInputModules ( GJobs [ 0 ] ) == [ " E " , " E " , " Swift " , " Swift " ] )
851849 XCTAssertTrue ( getInputModules ( GJobs [ 1 ] ) == [ " E " , " Swift " ] )
850+ XCTAssertTrue ( getInputModules ( GJobs [ 2 ] ) == [ " E " , " Swift " ] )
852851 XCTAssertTrue ( getOutputName ( GJobs [ 0 ] ) != getOutputName ( GJobs [ 1 ] ) )
852+ XCTAssertTrue ( getOutputName ( GJobs [ 1 ] ) != getOutputName ( GJobs [ 2 ] ) )
853853 checkInputOutputIntegrity ( GJobs [ 0 ] )
854854 checkInputOutputIntegrity ( GJobs [ 1 ] )
855855 }
@@ -861,28 +861,33 @@ final class ExplicitModuleBuildTests: XCTestCase {
861861 var driver = try Driver ( args: [ " swiftc " , main. pathString,
862862 " -sdk " , mockSDKPath,
863863 ] )
864-
865864 let ( jobs, danglingJobs) = try driver. generatePrebuitModuleGenerationJobs ( with: interfaceMap,
866865 into: VirtualPath ( path: " /tmp/ " ) . absolutePath!,
867866 exhaustive: false )
868867
869868 XCTAssertTrue ( danglingJobs. isEmpty)
870- XCTAssertTrue ( jobs. count == 13 )
869+ XCTAssertTrue ( jobs. count == 18 )
871870 XCTAssertTrue ( jobs. allSatisfy { $0. outputs. count == 1 } )
872871 XCTAssertTrue ( jobs. allSatisfy { $0. kind == . compile} )
873872 XCTAssertTrue ( jobs. allSatisfy { $0. commandLine. contains ( . flag( " -compile-module-from-interface " ) ) } )
874873 let HJobs = jobs. filter { $0. moduleName == " H " }
875- XCTAssertTrue ( HJobs . count == 2 )
876- XCTAssertTrue ( getInputModules ( HJobs [ 0 ] ) == [ " A " , " E " , " F " , " G " , " Swift " ] )
874+ XCTAssertTrue ( HJobs . count == 3 )
875+ // arm64
876+ XCTAssertTrue ( getInputModules ( HJobs [ 0 ] ) == [ " A " , " A " , " E " , " E " , " F " , " F " , " G " , " G " , " Swift " , " Swift " ] )
877+ // arm64e
877878 XCTAssertTrue ( getInputModules ( HJobs [ 1 ] ) == [ " A " , " E " , " F " , " G " , " Swift " ] )
879+ // x86_64
880+ XCTAssertTrue ( getInputModules ( HJobs [ 2 ] ) == [ " A " , " E " , " F " , " G " , " Swift " ] )
878881 XCTAssertTrue ( getOutputName ( HJobs [ 0 ] ) != getOutputName ( HJobs [ 1 ] ) )
879882 checkInputOutputIntegrity ( HJobs [ 0 ] )
880883 checkInputOutputIntegrity ( HJobs [ 1 ] )
881884 let GJobs = jobs. filter { $0. moduleName == " G " }
882- XCTAssertTrue ( GJobs . count == 2 )
883- XCTAssertTrue ( getInputModules ( GJobs [ 0 ] ) == [ " E " , " Swift " ] )
885+ XCTAssertTrue ( GJobs . count == 3 )
886+ XCTAssertTrue ( getInputModules ( GJobs [ 0 ] ) == [ " E " , " E " , " Swift " , " Swift " ] )
884887 XCTAssertTrue ( getInputModules ( GJobs [ 1 ] ) == [ " E " , " Swift " ] )
888+ XCTAssertTrue ( getInputModules ( GJobs [ 2 ] ) == [ " E " , " Swift " ] )
885889 XCTAssertTrue ( getOutputName ( GJobs [ 0 ] ) != getOutputName ( GJobs [ 1 ] ) )
890+ XCTAssertTrue ( getOutputName ( GJobs [ 1 ] ) != getOutputName ( GJobs [ 2 ] ) )
886891 checkInputOutputIntegrity ( GJobs [ 0 ] )
887892 checkInputOutputIntegrity ( GJobs [ 1 ] )
888893 }
@@ -894,13 +899,12 @@ final class ExplicitModuleBuildTests: XCTestCase {
894899 var driver = try Driver ( args: [ " swiftc " , main. pathString,
895900 " -sdk " , mockSDKPath,
896901 ] )
897-
898902 let ( jobs, danglingJobs) = try driver. generatePrebuitModuleGenerationJobs ( with: interfaceMap,
899903 into: VirtualPath ( path: " /tmp/ " ) . absolutePath!,
900904 exhaustive: false )
901905
902906 XCTAssertTrue ( danglingJobs. isEmpty)
903- XCTAssert ( jobs. count == 2 )
907+ XCTAssert ( jobs. count == 3 )
904908 XCTAssert ( jobs. allSatisfy { $0. moduleName == " Swift " } )
905909 }
906910 try withTemporaryDirectory { path in
@@ -911,13 +915,12 @@ final class ExplicitModuleBuildTests: XCTestCase {
911915 var driver = try Driver ( args: [ " swiftc " , main. pathString,
912916 " -sdk " , mockSDKPath,
913917 ] )
914-
915918 let ( jobs, danglingJobs) = try driver. generatePrebuitModuleGenerationJobs ( with: interfaceMap,
916919 into: VirtualPath ( path: " /tmp/ " ) . absolutePath!,
917920 exhaustive: false )
918921
919922 XCTAssertTrue ( danglingJobs. isEmpty)
920- XCTAssertTrue ( jobs. count == 7 )
923+ XCTAssertTrue ( jobs. count == 9 )
921924 jobs. forEach ( { job in
922925 // Check we don't pull in other modules than A, F and Swift
923926 XCTAssertTrue ( [ " A " , " F " , " Swift " ] . contains ( job. moduleName) )
@@ -932,7 +935,6 @@ final class ExplicitModuleBuildTests: XCTestCase {
932935 var driver = try Driver ( args: [ " swiftc " , main. pathString,
933936 " -sdk " , mockSDKPath,
934937 ] )
935-
936938 let ( jobs, _) = try driver. generatePrebuitModuleGenerationJobs ( with: interfaceMap,
937939 into: VirtualPath ( path: " /tmp/ " ) . absolutePath!,
938940 exhaustive: false )
0 commit comments