From 0195b3a9098eba9349f4291606581669b2bef548 Mon Sep 17 00:00:00 2001 From: Tim Keith Date: Mon, 4 May 2020 07:25:02 -0700 Subject: [PATCH] [flang] Fix bug in tests for standalone build When doing a standalone build of flang against an LLVM that contains a built flang, the tests were run on the flang from LLVM rather than on the one that was just built. The problem was in the lit configuration for finding %flang etc. Fix it to look only in the directory where it was built. Differential Revision: https://reviews.llvm.org/D79327 --- flang/test/lit.cfg.py | 20 ++++++++------------ flang/test/lit.site.cfg.py.in | 2 +- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/flang/test/lit.cfg.py b/flang/test/lit.cfg.py index 439f971..c1aa851 100644 --- a/flang/test/lit.cfg.py +++ b/flang/test/lit.cfg.py @@ -57,18 +57,14 @@ if config.flang_llvm_tools_dir != "" : 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 index 92bd926..e8e2945 100644 --- a/flang/test/lit.site.cfg.py.in +++ b/flang/test/lit.site.cfg.py.in @@ -7,7 +7,7 @@ config.flang_obj_root = "@FLANG_BINARY_DIR@" 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 -- 2.7.4