Skip to content

Commit 0195b3a

Browse files
committed
[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
1 parent fb18dff commit 0195b3a

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

flang/test/lit.cfg.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,14 @@
5757
config.substitutions.append(('%B', config.flang_obj_root))
5858

5959
# For each occurrence of a flang tool name, replace it with the full path to
60-
# the build directory holding that tool. We explicitly specify the directories
61-
# to search to ensure that we get the tools just built and not some random
62-
# tools that might happen to be in the user's PATH.
63-
tool_dirs = [config.llvm_tools_dir, config.flang_tools_dir]
64-
flang_includes = "-I" + config.flang_intrinsic_modules_dir
65-
66-
tools = [ToolSubst('%flang', command=FindTool('flang'), unresolved='fatal'),
67-
ToolSubst('%f18', command=FindTool('f18'), unresolved='fatal'),
68-
ToolSubst('%f18_with_includes', command=FindTool('f18'),
69-
extra_args=[flang_includes], unresolved='fatal')]
70-
71-
llvm_config.add_tool_substitutions(tools, tool_dirs)
60+
# the build directory holding that tool.
61+
tools = [
62+
ToolSubst('%flang', command=FindTool('flang'), unresolved='fatal'),
63+
ToolSubst('%f18', command=FindTool('f18'), unresolved='fatal'),
64+
ToolSubst('%f18_with_includes', command=FindTool('f18'),
65+
extra_args=["-I" + config.flang_intrinsic_modules_dir], unresolved='fatal')
66+
]
67+
llvm_config.add_tool_substitutions(tools, [config.flang_llvm_tools_dir])
7268

7369
# Enable libpgmath testing
7470
result = lit_config.params.get("LIBPGMATH")

flang/test/lit.site.cfg.py.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ config.flang_obj_root = "@FLANG_BINARY_DIR@"
77
config.flang_src_dir = "@FLANG_SOURCE_DIR@"
88
config.flang_tools_dir = "@FLANG_TOOLS_DIR@"
99
config.flang_intrinsic_modules_dir = "@FLANG_INTRINSIC_MODULES_DIR@"
10-
config.flang_llvm_tools_dir = "@LLVM_RUNTIME_OUTPUT_INTDIR@"
10+
config.flang_llvm_tools_dir = "@CMAKE_BINARY_DIR@/bin"
1111
config.python_executable = "@PYTHON_EXECUTABLE@"
1212

1313
# Support substitution of the tools_dir with user parameters. This is

0 commit comments

Comments
 (0)