summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Chan <bryan.chan@huawei.com>2019-11-28 02:46:18 -0500
committerBryan Chan <bryan.chan@huawei.com>2019-11-28 17:43:56 -0500
commit4d3198e243fa450a4109fd72ae1999f1a13570fa (patch)
tree965dd5d764403d68845aa4b8ce86ecadb544e528
parent4adddbd8ad4f71e8ce4cb4a38c755b126c5e9eff (diff)
downloadbcm5719-llvm-4d3198e243fa450a4109fd72ae1999f1a13570fa.tar.gz
bcm5719-llvm-4d3198e243fa450a4109fd72ae1999f1a13570fa.zip
[OpenMP] build offload plugins before testing them
Summary: "make check-all" or "make check-libomptarget" would attempt to run offloading tests before the offload plugins are built. This patch corrects that by adding dependencies to the libomptarget CMake rules. Reviewers: jdoerfert Subscribers: mgorny, guansong, openmp-commits Tags: #openmp Differential Revision: https://reviews.llvm.org/D70803
-rw-r--r--openmp/libomptarget/CMakeLists.txt1
-rw-r--r--openmp/libomptarget/plugins/CMakeLists.txt6
-rw-r--r--openmp/libomptarget/test/CMakeLists.txt2
3 files changed, 8 insertions, 1 deletions
diff --git a/openmp/libomptarget/CMakeLists.txt b/openmp/libomptarget/CMakeLists.txt
index a953662bf8b..c1bc29faaf4 100644
--- a/openmp/libomptarget/CMakeLists.txt
+++ b/openmp/libomptarget/CMakeLists.txt
@@ -39,6 +39,7 @@ set (LIBOMPTARGET_ALL_TARGETS "${LIBOMPTARGET_ALL_TARGETS} nvptx64-nvidia-cuda")
# Once the plugins for the different targets are validated, they will be added to
# the list of supported targets in the current system.
set (LIBOMPTARGET_SYSTEM_TARGETS "")
+set (LIBOMPTARGET_TESTED_PLUGINS "")
# Check whether using debug mode. In debug mode, allow dumping progress
# messages at runtime by default. Otherwise, it can be enabled
diff --git a/openmp/libomptarget/plugins/CMakeLists.txt b/openmp/libomptarget/plugins/CMakeLists.txt
index f8048ba69c0..bb3f9c90808 100644
--- a/openmp/libomptarget/plugins/CMakeLists.txt
+++ b/openmp/libomptarget/plugins/CMakeLists.txt
@@ -45,9 +45,14 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "${tmachine}$")
dl
"-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/../exports")
+ list(APPEND LIBOMPTARGET_TESTED_PLUGINS
+ "omptarget.rtl.${tmachine_libname}")
+
# Report to the parent scope that we are building a plugin.
set(LIBOMPTARGET_SYSTEM_TARGETS
"${LIBOMPTARGET_SYSTEM_TARGETS} ${tmachine_triple}" PARENT_SCOPE)
+ set(LIBOMPTARGET_TESTED_PLUGINS
+ "${LIBOMPTARGET_TESTED_PLUGINS}" PARENT_SCOPE)
else(LIBOMPTARGET_DEP_LIBFFI_FOUND)
libomptarget_say("Not building ${tmachine_name} offloading plugin: libffi dependency not found.")
@@ -68,4 +73,5 @@ add_subdirectory(x86_64)
# Make sure the parent scope can see the plugins that will be created.
set(LIBOMPTARGET_SYSTEM_TARGETS "${LIBOMPTARGET_SYSTEM_TARGETS}" PARENT_SCOPE)
+set(LIBOMPTARGET_TESTED_PLUGINS "${LIBOMPTARGET_TESTED_PLUGINS}" PARENT_SCOPE)
diff --git a/openmp/libomptarget/test/CMakeLists.txt b/openmp/libomptarget/test/CMakeLists.txt
index 607801e50e5..aa3fffcfe60 100644
--- a/openmp/libomptarget/test/CMakeLists.txt
+++ b/openmp/libomptarget/test/CMakeLists.txt
@@ -12,7 +12,7 @@ else()
set(LIBOMPTARGET_DEBUG False)
endif()
-add_openmp_testsuite(check-libomptarget "Running libomptarget tests" ${CMAKE_CURRENT_BINARY_DIR} DEPENDS omptarget omp)
+add_openmp_testsuite(check-libomptarget "Running libomptarget tests" ${CMAKE_CURRENT_BINARY_DIR} DEPENDS omptarget omp ${LIBOMPTARGET_TESTED_PLUGINS})
# Configure the lit.site.cfg.in file
set(AUTO_GEN_COMMENT "## Autogenerated by libomptarget configuration.\n# Do not edit!")
OpenPOWER on IntegriCloud