aboutsummaryrefslogtreecommitdiff
path: root/libomptarget
diff options
context:
space:
mode:
authorJonas Hahnfeld <hahnjo@hahnjo.de>2017-11-30 17:08:31 +0000
committerJonas Hahnfeld <hahnjo@hahnjo.de>2017-11-30 17:08:31 +0000
commitd180ffbb8271a6de6cebfa7c773f3709dfbb2686 (patch)
treee03b42b0a750b821336fc41753e6768d2a600715 /libomptarget
parent1696d28687e5f01d83d2f6debedcb4ce865d10be (diff)
[CMake] Detect information about test compiler
Perform a nested CMake invocation to avoid writing our own parser for compiler versions when we are not testing the in-tree compiler. Use the extracted information to mark a test as unsupported that hangs with Clang prior to version 4.0.1 and restrict tests for libomptarget to Clang version 6.0.0 and later. Differential Revision: https://reviews.llvm.org/D40083 git-svn-id: https://llvm.org/svn/llvm-project/openmp/trunk@319448 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'libomptarget')
-rw-r--r--libomptarget/test/CMakeLists.txt30
1 files changed, 6 insertions, 24 deletions
diff --git a/libomptarget/test/CMakeLists.txt b/libomptarget/test/CMakeLists.txt
index a063f47..1662ff7 100644
--- a/libomptarget/test/CMakeLists.txt
+++ b/libomptarget/test/CMakeLists.txt
@@ -1,4 +1,10 @@
# CMakeLists.txt file for unit testing OpenMP offloading runtime library.
+if(NOT "${OPENMP_TEST_COMPILER_ID}" STREQUAL "Clang" OR
+ ${OPENMP_TEST_COMPILER_VERSION} VERSION_LESS 6.0.0)
+ libomptarget_say("Can only test with Clang compiler in version 6.0.0 or later.")
+ libomptarget_warning_say("The check-libomptarget target will not be available!")
+ return()
+endif()
if(LIBOMPTARGET_CMAKE_BUILD_TYPE MATCHES debug)
set(LIBOMPTARGET_DEBUG True)
@@ -6,30 +12,6 @@ else()
set(LIBOMPTARGET_DEBUG False)
endif()
-if(${OPENMP_STANDALONE_BUILD})
- if (NOT(${OPENMP_TEST_C_COMPILER} MATCHES "clang" AND ${OPENMP_TEST_CXX_COMPILER} MATCHES "clang"))
- libomptarget_say("Can only test with Clang compiler!")
- libomptarget_warning_say("The check-libomptarget target will not be available!")
- return()
- endif()
-
- execute_process(
- COMMAND ${OPENMP_TEST_C_COMPILER} --version
- OUTPUT_VARIABLE TEST_COMPILER_VERSION)
- string(REGEX MATCH "version ([0-9.]+)" TEST_COMPILER_VERSION ${TEST_COMPILER_VERSION})
- if (NOT(TEST_COMPILER_VERSION))
- libomptarget_say("Unable to determine Clang compiler version!")
- libomptarget_warning_say("The check-libomptarget target will not be available!")
- return()
- endif()
- set(TEST_COMPILER_VERSION ${CMAKE_MATCH_1})
- if (TEST_COMPILER_VERSION VERSION_LESS 6.0.0)
- libomptarget_say("Clang compiler version does not implement all codegen, please update to 6.0.0!")
- libomptarget_warning_say("The check-libomptarget target will not be available!")
- return()
- endif()
-endif()
-
add_openmp_testsuite(check-libomptarget "Running libomptarget tests" ${CMAKE_CURRENT_BINARY_DIR} DEPENDS omptarget omp)
if(${OPENMP_STANDALONE_BUILD})