[PATCH] D79327: [flang] Fix bug in tests for standalone build

Tim Keith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 4 07:59:44 PDT 2020


tskeith created this revision.
tskeith added a reviewer: CarolineConcatto.
tskeith added a project: Flang.
Herald added a reviewer: jdoerfert.
Herald added a reviewer: DavidTruby.
Herald added a reviewer: sscalpone.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D79327

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


Index: flang/test/lit.site.cfg.py.in
===================================================================
--- flang/test/lit.site.cfg.py.in
+++ 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
Index: flang/test/lit.cfg.py
===================================================================
--- flang/test/lit.cfg.py
+++ 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")


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79327.261814.patch
Type: text/x-patch
Size: 2052 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200504/c84ece15/attachment.bin>


More information about the llvm-commits mailing list