[llvm] [offload] [test] Use test compiler ID rather than host (PR #124408)

via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 25 05:50:21 PST 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-offload

Author: Michał Górny (mgorny)

<details>
<summary>Changes</summary>

Use the test compiler ID to verify whether tests can be run rather than the host compiler.  This makes it possible to run tests (with Clang) while the library itself was built with GCC.

---
Full diff: https://github.com/llvm/llvm-project/pull/124408.diff


1 Files Affected:

- (modified) offload/test/CMakeLists.txt (+2-2) 


``````````diff
diff --git a/offload/test/CMakeLists.txt b/offload/test/CMakeLists.txt
index 8a827e0a625eff..4768d9ccf223bb 100644
--- a/offload/test/CMakeLists.txt
+++ b/offload/test/CMakeLists.txt
@@ -1,6 +1,6 @@
 # CMakeLists.txt file for unit testing OpenMP offloading runtime library.
-if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR
-   CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.0.0)
+if(NOT OPENMP_TEST_COMPILER_ID STREQUAL "Clang" OR
+   OPENMP_TEST_COMPILER_VERSION VERSION_LESS 6.0.0)
   message(STATUS "Can only test with Clang compiler in version 6.0.0 or later.")
   message(WARNING "The check-offload target will not be available!")
   return()

``````````

</details>


https://github.com/llvm/llvm-project/pull/124408


More information about the llvm-commits mailing list