[flang-commits] [flang] 0195b3a - [flang] Fix bug in tests for standalone build
Tim Keith via flang-commits
flang-commits at lists.llvm.org
Tue May 5 11:09:08 PDT 2020
Author: Tim Keith
Date: 2020-05-05T11:08:23-07:00
New Revision: 0195b3a9098eba9349f4291606581669b2bef548
URL: https://github.com/llvm/llvm-project/commit/0195b3a9098eba9349f4291606581669b2bef548
DIFF: https://github.com/llvm/llvm-project/commit/0195b3a9098eba9349f4291606581669b2bef548.diff
LOG: [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
Added:
Modified:
flang/test/lit.cfg.py
flang/test/lit.site.cfg.py.in
Removed:
################################################################################
diff --git a/flang/test/lit.cfg.py b/flang/test/lit.cfg.py
index 439f9710ef66..c1aa851097b7 100644
--- 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
index 92bd926ab5ca..e8e2945a2cbf 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
More information about the flang-commits
mailing list