@@ -1019,7 +1019,7 @@ impl Step for Compiletest {
10191019
10201020 // Only pass correct values for these flags for the `run-make` suite as it
10211021 // requires that a C++ compiler was configured which isn't always the case.
1022- if !builder. config . dry_run && suite == "run-make-fulldeps " {
1022+ if !builder. config . dry_run && mode == "run-make" {
10231023 let llvm_components = output ( Command :: new ( & llvm_config) . arg ( "--components" ) ) ;
10241024 let llvm_cxxflags = output ( Command :: new ( & llvm_config) . arg ( "--cxxflags" ) ) ;
10251025 cmd. arg ( "--cc" ) . arg ( builder. cc ( target) )
@@ -1030,15 +1030,26 @@ impl Step for Compiletest {
10301030 if let Some ( ar) = builder. ar ( target) {
10311031 cmd. arg ( "--ar" ) . arg ( ar) ;
10321032 }
1033+
1034+ // Add the llvm/bin directory to PATH since it contains lots of
1035+ // useful, platform-independent tools
1036+ let llvm_bin_path = llvm_config. parent ( )
1037+ . expect ( "Expected llvm-config to be contained in directory" ) ;
1038+ assert ! ( llvm_bin_path. is_dir( ) ) ;
1039+ let old_path = env:: var_os ( "PATH" ) . unwrap_or_default ( ) ;
1040+ let new_path = env:: join_paths ( iter:: once ( llvm_bin_path. to_path_buf ( ) )
1041+ . chain ( env:: split_paths ( & old_path) ) )
1042+ . expect ( "" ) ;
1043+ cmd. env ( "PATH" , new_path) ;
10331044 }
10341045 }
1035- if suite == "run-make-fulldeps " && !builder. config . llvm_enabled {
1046+ if mode == "run-make" && !builder. config . llvm_enabled {
10361047 builder. info (
10371048 & format ! ( "Ignoring run-make test suite as they generally don't work without LLVM" ) ) ;
10381049 return ;
10391050 }
10401051
1041- if suite != "run-make-fulldeps " {
1052+ if mode != "run-make" {
10421053 cmd. arg ( "--cc" ) . arg ( "" )
10431054 . arg ( "--cxx" ) . arg ( "" )
10441055 . arg ( "--cflags" ) . arg ( "" )
0 commit comments