diff --git a/flang/test/lit.cfg.py b/flang/test/lit.cfg.py --- a/flang/test/lit.cfg.py +++ b/flang/test/lit.cfg.py @@ -57,18 +57,14 @@ config.substitutions.append(('%B', config.flang_obj_root)) # For each occurrence of a flang tool name, replace it with the full path to -# the build directory holding that tool. We explicitly specify the directories -# to search to ensure that we get the tools just built and not some random -# tools that might happen to be in the user's PATH. -tool_dirs = [config.llvm_tools_dir, config.flang_tools_dir] -flang_includes = "-I" + config.flang_intrinsic_modules_dir - -tools = [ToolSubst('%flang', command=FindTool('flang'), unresolved='fatal'), - ToolSubst('%f18', command=FindTool('f18'), unresolved='fatal'), - ToolSubst('%f18_with_includes', command=FindTool('f18'), - extra_args=[flang_includes], unresolved='fatal')] - -llvm_config.add_tool_substitutions(tools, tool_dirs) +# the build directory holding that tool. +tools = [ + ToolSubst('%flang', command=FindTool('flang'), unresolved='fatal'), + ToolSubst('%f18', command=FindTool('f18'), unresolved='fatal'), + ToolSubst('%f18_with_includes', command=FindTool('f18'), + extra_args=["-I" + config.flang_intrinsic_modules_dir], unresolved='fatal') +] +llvm_config.add_tool_substitutions(tools, [config.flang_llvm_tools_dir]) # Enable libpgmath testing result = lit_config.params.get("LIBPGMATH") diff --git a/flang/test/lit.site.cfg.py.in b/flang/test/lit.site.cfg.py.in --- a/flang/test/lit.site.cfg.py.in +++ b/flang/test/lit.site.cfg.py.in @@ -7,7 +7,7 @@ config.flang_src_dir = "@FLANG_SOURCE_DIR@" config.flang_tools_dir = "@FLANG_TOOLS_DIR@" config.flang_intrinsic_modules_dir = "@FLANG_INTRINSIC_MODULES_DIR@" -config.flang_llvm_tools_dir = "@LLVM_RUNTIME_OUTPUT_INTDIR@" +config.flang_llvm_tools_dir = "@CMAKE_BINARY_DIR@/bin" config.python_executable = "@PYTHON_EXECUTABLE@" # Support substitution of the tools_dir with user parameters. This is