diff options
author | Joel E. Denny <jdenny.ornl@gmail.com> | 2020-04-21 16:27:32 -0400 |
---|---|---|
committer | Joel E. Denny <jdenny.ornl@gmail.com> | 2020-04-21 17:10:50 -0400 |
commit | ba942610f6be63fe11b61e637ca5db2c4ef9ba8a (patch) | |
tree | 4ddb7185a2e903a6fbc1413eb31ce93d71e817a8 /openmp/cmake | |
parent | 060efd24c7f06a6c66afc15fc5c499eb0d591523 (diff) | |
download | llvm-ba942610f6be63fe11b61e637ca5db2c4ef9ba8a.zip llvm-ba942610f6be63fe11b61e637ca5db2c4ef9ba8a.tar.gz llvm-ba942610f6be63fe11b61e637ca5db2c4ef9ba8a.tar.bz2 |
[OpenMP] Add scaffolding for negative runtime tests
Without this patch, the openmp project's test suites do not appear to
have support for negative tests. However, D78170 needs to add a test
that an expected runtime failure occurs.
This patch makes `not` visible in all of the openmp project's test
suites. In all but `libomptarget/test`, it should be possible for a
test author to insert `not` before a use of the lit substitution for
running a test program. In `libomptarget/test`, that substitution is
target-specific, and its value is `echo` when the target is not
available. In that case, inserting `not` before a lit substitution
would expect an `echo` fail, so this patch instead defines a separate
lit substitution for expected runtime fails.
Reviewed By: jdoerfert, Hahnfeld
Differential Revision: https://reviews.llvm.org/D78566
Diffstat (limited to 'openmp/cmake')
-rw-r--r-- | openmp/cmake/OpenMPTesting.cmake | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/openmp/cmake/OpenMPTesting.cmake b/openmp/cmake/OpenMPTesting.cmake index c776b8a..f854e4d 100644 --- a/openmp/cmake/OpenMPTesting.cmake +++ b/openmp/cmake/OpenMPTesting.cmake @@ -34,6 +34,17 @@ function(find_standalone_test_dependencies) set(ENABLE_CHECK_TARGETS FALSE PARENT_SCOPE) return() endif() + + find_program(OPENMP_NOT_EXECUTABLE + NAMES not + PATHS ${OPENMP_LLVM_TOOLS_DIR}) + if (NOT OPENMP_NOT_EXECUTABLE) + message(STATUS "Cannot find 'not'.") + message(STATUS "Please put 'not' in your PATH, set OPENMP_NOT_EXECUTABLE to its full path, or point OPENMP_LLVM_TOOLS_DIR to its directory.") + message(WARNING "The check targets will not be available!") + set(ENABLE_CHECK_TARGETS FALSE PARENT_SCOPE) + return() + endif() endfunction() if (${OPENMP_STANDALONE_BUILD}) @@ -55,6 +66,7 @@ if (${OPENMP_STANDALONE_BUILD}) separate_arguments(OPENMP_LIT_ARGS) else() set(OPENMP_FILECHECK_EXECUTABLE ${LLVM_RUNTIME_OUTPUT_INTDIR}/FileCheck) + set(OPENMP_NOT_EXECUTABLE ${LLVM_RUNTIME_OUTPUT_INTDIR}/not) endif() # Macro to extract information about compiler from file. (no own scope) |