@@ -971,7 +971,7 @@ impl Step for Compiletest {
971971
972972 // Only pass correct values for these flags for the `run-make` suite as it
973973 // requires that a C++ compiler was configured which isn't always the case.
974- if !builder. config . dry_run && suite == "run-make-fulldeps " {
974+ if !builder. config . dry_run && mode == "run-make" {
975975 let llvm_components = output ( Command :: new ( & llvm_config) . arg ( "--components" ) ) ;
976976 let llvm_cxxflags = output ( Command :: new ( & llvm_config) . arg ( "--cxxflags" ) ) ;
977977 cmd. arg ( "--cc" ) . arg ( builder. cc ( target) )
@@ -982,15 +982,26 @@ impl Step for Compiletest {
982982 if let Some ( ar) = builder. ar ( target) {
983983 cmd. arg ( "--ar" ) . arg ( ar) ;
984984 }
985+
986+ // Add the llvm/bin directory to PATH since it contains lots of
987+ // useful, platform-independent tools
988+ let llvm_bin_path = llvm_config. parent ( )
989+ . expect ( "Expected llvm-config to be contained in directory" ) ;
990+ assert ! ( llvm_bin_path. is_dir( ) ) ;
991+ let old_path = env:: var_os ( "PATH" ) . unwrap_or_default ( ) ;
992+ let new_path = env:: join_paths ( iter:: once ( llvm_bin_path. to_path_buf ( ) )
993+ . chain ( env:: split_paths ( & old_path) ) )
994+ . expect ( "" ) ;
995+ cmd. env ( "PATH" , new_path) ;
985996 }
986997 }
987- if suite == "run-make-fulldeps " && !builder. config . llvm_enabled {
998+ if mode == "run-make" && !builder. config . llvm_enabled {
988999 builder. info (
9891000 & format ! ( "Ignoring run-make test suite as they generally don't work without LLVM" ) ) ;
9901001 return ;
9911002 }
9921003
993- if suite != "run-make-fulldeps " {
1004+ if mode != "run-make" {
9941005 cmd. arg ( "--cc" ) . arg ( "" )
9951006 . arg ( "--cxx" ) . arg ( "" )
9961007 . arg ( "--cflags" ) . arg ( "" )
0 commit comments