@@ -3542,6 +3542,49 @@ final class SwiftDriverTests: XCTestCase {
35423542    try checkSupplementaryOutputFileMap ( format:  " bitstream " ,  . bitstreamOptimizationRecord) 
35433543  } 
35443544
3545+   func  testOptimizationRecordPathUserProvidedPath( )  throws  { 
3546+ 
3547+     do  { 
3548+       var  driver  =  try Driver ( args:  [ 
3549+         " swiftc " ,  " -save-optimization-record " ,  " -save-optimization-record-path " ,  " /tmp/test.opt.yaml " , 
3550+         " -c " ,  " test.swift " 
3551+       ] ) 
3552+       let  plannedJobs  =  try . planBuild ( ) 
3553+       let  compileJob  =  try XCTUnwrap ( plannedJobs. first  {  $0. kind ==  . compile } ) 
3554+ 
3555+       XCTAssertTrue ( compileJob. commandLine. contains ( . path( VirtualPath . absolute ( try AbsolutePath ( validating:  " /tmp/test.opt.yaml " ) ) ) ) ) 
3556+       XCTAssertTrue ( compileJob. commandLine. contains ( . flag( " -save-optimization-record-path " ) ) ) 
3557+     } 
3558+ 
3559+     do  { 
3560+       var  driver  =  try Driver ( args:  [ 
3561+         " swiftc " ,  " -wmo " ,  " -save-optimization-record " ,  " -save-optimization-record-path " ,  " /tmp/wmo.opt.yaml " , 
3562+         " -c " ,  " test.swift " 
3563+       ] ) 
3564+       let  plannedJobs  =  try . planBuild ( ) 
3565+       let  compileJob  =  try XCTUnwrap ( plannedJobs. first  {  $0. kind ==  . compile } ) 
3566+ 
3567+       XCTAssertTrue ( compileJob. commandLine. contains ( . path( VirtualPath . absolute ( try AbsolutePath ( validating:  " /tmp/wmo.opt.yaml " ) ) ) ) ) 
3568+       XCTAssertTrue ( compileJob. commandLine. contains ( . flag( " -save-optimization-record-path " ) ) ) 
3569+     } 
3570+ 
3571+     do  { 
3572+       var  driver  =  try Driver ( args:  [ 
3573+         " swiftc " ,  " -wmo " ,  " -num-threads " ,  " 4 " ,  " -save-optimization-record " , 
3574+         " -save-optimization-record-path " ,  " /tmp/mt1.opt.yaml " , 
3575+         " -save-optimization-record-path " ,  " /tmp/mt2.opt.yaml " , 
3576+         " -c " ,  " test1.swift " ,  " test2.swift " 
3577+       ] ) 
3578+       let  plannedJobs  =  try . planBuild ( ) 
3579+       let  compileJob  =  try XCTUnwrap ( plannedJobs. first  {  $0. kind ==  . compile } ) 
3580+ 
3581+       XCTAssertTrue ( compileJob. commandLine. contains ( . flag( " -save-optimization-record-path " ) ) ) 
3582+       let  hasFirstPath  =  compileJob. commandLine. contains ( . path( VirtualPath . absolute ( try AbsolutePath ( validating:  " /tmp/mt1.opt.yaml " ) ) ) ) 
3583+       let  hasSecondPath  =  compileJob. commandLine. contains ( . path( VirtualPath . absolute ( try AbsolutePath ( validating:  " /tmp/mt2.opt.yaml " ) ) ) ) 
3584+       XCTAssertTrue ( hasFirstPath || hasSecondPath,  " Should contain at least one user-provided optimization record path " ) 
3585+     } 
3586+   } 
3587+ 
35453588  func  testUpdateCode( )  throws  { 
35463589    do  { 
35473590      var  driver  =  try Driver ( args:  [ 
0 commit comments