[Openmp-commits] [PATCH] D95689: [OpenMP] Disable tests if FileCheck is not available in in-tree building

Shilei Tian via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Fri Jan 29 11:10:41 PST 2021


tianshilei1992 created this revision.
Herald added subscribers: guansong, yaxunl, mgorny.
tianshilei1992 requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added subscribers: openmp-commits, sstefan1.
Herald added a project: OpenMP.

FileCheck is required for OpenMP tests. The current detection can fail
if building OpenMP in-tree when user sets `LLVM_INSTALL_TOOLCHAIN_ONLY=ON`. As a
result, CMake will raise an error and the compilation will be broken. This patch
fixed the issue. When `FileCheck` is not a target, tests will just be skipped.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D95689

Files:
  openmp/cmake/OpenMPTesting.cmake


Index: openmp/cmake/OpenMPTesting.cmake
===================================================================
--- openmp/cmake/OpenMPTesting.cmake
+++ openmp/cmake/OpenMPTesting.cmake
@@ -58,7 +58,13 @@
   set(OPENMP_LIT_ARGS "${DEFAULT_LIT_ARGS}" CACHE STRING "Options for lit.")
   separate_arguments(OPENMP_LIT_ARGS)
 else()
-  set(OPENMP_FILECHECK_EXECUTABLE ${LLVM_RUNTIME_OUTPUT_INTDIR}/FileCheck)
+  if (NOT TARGET "FileCheck")
+    message(STATUS "Cannot find 'FileCheck'.")
+    message(WARNING "The check targets will not be available!")
+    set(ENABLE_CHECK_TARGETS FALSE)
+  else()
+    set(OPENMP_FILECHECK_EXECUTABLE ${LLVM_RUNTIME_OUTPUT_INTDIR}/FileCheck)
+  endif()
   set(OPENMP_NOT_EXECUTABLE ${LLVM_RUNTIME_OUTPUT_INTDIR}/not)
 endif()
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D95689.320177.patch
Type: text/x-patch
Size: 757 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20210129/7688f98c/attachment.bin>


More information about the Openmp-commits mailing list