diff options
author | Robert Maynard <robert.maynard@kitware.com> | 2020-10-25 18:34:18 (GMT) |
---|---|---|
committer | Zack Galbreath <zack.galbreath@kitware.com> | 2021-06-07 19:25:33 (GMT) |
commit | 2e86e50c2fb2897dc1a0612676c5bd26eb7924a9 (patch) | |
tree | 1a788cb67645e12353c4c0d875601edbeeb21159 /Tests/RunCMake/CheckSourceRuns/CheckHIPSourceRuns.cmake | |
parent | 947dbed0aa502c70a9e165757450bd8409036980 (diff) | |
download | CMake-2e86e50c2fb2897dc1a0612676c5bd26eb7924a9.zip CMake-2e86e50c2fb2897dc1a0612676c5bd26eb7924a9.tar.gz CMake-2e86e50c2fb2897dc1a0612676c5bd26eb7924a9.tar.bz2 |
HIP: Add HIP to all the Check* modules
Diffstat (limited to 'Tests/RunCMake/CheckSourceRuns/CheckHIPSourceRuns.cmake')
-rw-r--r-- | Tests/RunCMake/CheckSourceRuns/CheckHIPSourceRuns.cmake | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Tests/RunCMake/CheckSourceRuns/CheckHIPSourceRuns.cmake b/Tests/RunCMake/CheckSourceRuns/CheckHIPSourceRuns.cmake new file mode 100644 index 0000000..d9fb8c2 --- /dev/null +++ b/Tests/RunCMake/CheckSourceRuns/CheckHIPSourceRuns.cmake @@ -0,0 +1,21 @@ + +enable_language (HIP) +include(CheckSourceRuns) + +check_source_runs(HIP "int main() {return 2;}" SHOULD_FAIL) +if(SHOULD_FAIL) + message(SEND_ERROR "HIP check_source_runs succeeded, but should have failed.") +endif() + +check_source_runs(HIP +[=[ + #include <vector> + __device__ __host__ void fake_function(); + __host__ int main() { + return 0; + } +]=] + SHOULD_RUN) +if(NOT SHOULD_RUN) + message(SEND_ERROR "HIP check_source_runs failed for valid HIP executable.") +endif() |