[llvm] [NFC][Offload] Move conformance test warning outside of function (PR #152466)
Ross Brunton via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 7 02:28:26 PDT 2025
https://github.com/RossBrunton created https://github.com/llvm/llvm-project/pull/152466
`add_conformance_test` checks for libc and prints a warning if it is not
found. However, this warning ends up being printed once for each test,
spamming the cmake log. Moving it up to the folder cmake allows it to
be reported only once.
>From fa6b339201947097c4ca88cf7b7c4fcf425ff300 Mon Sep 17 00:00:00 2001
From: Ross Brunton <ross at codeplay.com>
Date: Thu, 7 Aug 2025 10:24:29 +0100
Subject: [PATCH] [NFC][Offload] Move conformance test warning outside of
function
`add_conformance_test` checks for libc and prints a warning if it is not
found. However, this warning ends up being printed once for each test,
spamming the cmake log. Moving it up to the folder cmake allows it to
be reported only once.
---
offload/unittests/CMakeLists.txt | 5 -----
offload/unittests/Conformance/tests/CMakeLists.txt | 5 +++++
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/offload/unittests/CMakeLists.txt b/offload/unittests/CMakeLists.txt
index 726d3eef59c8f..a0d5c01263056 100644
--- a/offload/unittests/CMakeLists.txt
+++ b/offload/unittests/CMakeLists.txt
@@ -104,11 +104,6 @@ function(add_conformance_test test_name)
list(TRANSFORM ARGN PREPEND "${CMAKE_CURRENT_SOURCE_DIR}/" OUTPUT_VARIABLE files)
- if(NOT TARGET libc)
- message(WARNING "Cannot run conformance tests without the LLVM C library")
- return()
- endif()
-
add_executable(${target_name} ${files})
add_dependencies(${target_name} conformance_device_binaries)
target_compile_definitions(${target_name}
diff --git a/offload/unittests/Conformance/tests/CMakeLists.txt b/offload/unittests/Conformance/tests/CMakeLists.txt
index 5c0c3ba55c062..8c0109ba62ce3 100644
--- a/offload/unittests/Conformance/tests/CMakeLists.txt
+++ b/offload/unittests/Conformance/tests/CMakeLists.txt
@@ -1,3 +1,8 @@
+if(NOT TARGET libc)
+ message(WARNING "Cannot run conformance tests without the LLVM C library")
+ return()
+endif()
+
add_conformance_test(acosf AcosfTest.cpp)
add_conformance_test(acoshf AcoshfTest.cpp)
add_conformance_test(asinf AsinfTest.cpp)
More information about the llvm-commits
mailing list