Skip to content

[offload] [test] Use test compiler ID rather than host #124408

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 2, 2025

Conversation

mgorny
Copy link
Member

@mgorny mgorny commented Jan 25, 2025

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.

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.
@llvmbot
Copy link
Member

llvmbot commented Jan 25, 2025

@llvm/pr-subscribers-offload

Author: Michał Górny (mgorny)

Changes

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 --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()

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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we really need this check anymore.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I was kinda surprised to see it. It's kinda true you usually can't test runtimes without Clang, but not sure if runtimes really need to explicitly assert that.

@mgorny mgorny merged commit 689ef5f into llvm:main Feb 2, 2025
8 checks passed
swift-ci pushed a commit to swiftlang/llvm-project that referenced this pull request Feb 5, 2025
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.

(cherry picked from commit 689ef5f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants