@@ -1019,7 +1019,7 @@ impl Step for Compiletest {
1019
1019
1020
1020
// Only pass correct values for these flags for the `run-make` suite as it
1021
1021
// 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" {
1023
1023
let llvm_components = output ( Command :: new ( & llvm_config) . arg ( "--components" ) ) ;
1024
1024
let llvm_cxxflags = output ( Command :: new ( & llvm_config) . arg ( "--cxxflags" ) ) ;
1025
1025
cmd. arg ( "--cc" ) . arg ( builder. cc ( target) )
@@ -1030,15 +1030,26 @@ impl Step for Compiletest {
1030
1030
if let Some ( ar) = builder. ar ( target) {
1031
1031
cmd. arg ( "--ar" ) . arg ( ar) ;
1032
1032
}
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) ;
1033
1044
}
1034
1045
}
1035
- if suite == "run-make-fulldeps " && !builder. config . llvm_enabled {
1046
+ if mode == "run-make" && !builder. config . llvm_enabled {
1036
1047
builder. info (
1037
1048
& format ! ( "Ignoring run-make test suite as they generally don't work without LLVM" ) ) ;
1038
1049
return ;
1039
1050
}
1040
1051
1041
- if suite != "run-make-fulldeps " {
1052
+ if mode != "run-make" {
1042
1053
cmd. arg ( "--cc" ) . arg ( "" )
1043
1054
. arg ( "--cxx" ) . arg ( "" )
1044
1055
. arg ( "--cflags" ) . arg ( "" )
0 commit comments