diff options
| author | Marcell Leleszi <59964679+mleleszi@users.noreply.github.com> | 2025-11-05 20:17:13 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-11-05 11:17:13 -0800 |
| commit | 3d0a3674d9ae52ed685ce467a48653cc27a2e5eb (patch) | |
| tree | 704005d1ad7b22631d3b6a0d90c476d6350f17cd /libc/test/IntegrationTest | |
| parent | 28a279ce14f913df71546d8201d5363682a75901 (diff) | |
[libc] Make errno asserts noop on gpu targets (#166606)
This patch defines errno unit and integration test asserts as noop on
GPU targets. Checking for errnos is tests has caused build breakages in
previous patches.
Diffstat (limited to 'libc/test/IntegrationTest')
| -rw-r--r-- | libc/test/IntegrationTest/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | libc/test/IntegrationTest/test.h | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/libc/test/IntegrationTest/CMakeLists.txt b/libc/test/IntegrationTest/CMakeLists.txt index 235e9fe2f55e..d0752ea17842 100644 --- a/libc/test/IntegrationTest/CMakeLists.txt +++ b/libc/test/IntegrationTest/CMakeLists.txt @@ -14,5 +14,6 @@ add_object_library( libc.hdr.stdint_proxy libc.src.__support.OSUtil.osutil libc.src.__support.CPP.atomic + libc.src.__support.macros.properties.architectures ${arch_specific_deps} ) diff --git a/libc/test/IntegrationTest/test.h b/libc/test/IntegrationTest/test.h index 4a03f7aa6318..9f5a3dfb3583 100644 --- a/libc/test/IntegrationTest/test.h +++ b/libc/test/IntegrationTest/test.h @@ -11,6 +11,7 @@ #include "src/__support/OSUtil/exit.h" #include "src/__support/OSUtil/io.h" +#include "src/__support/macros/properties/architectures.h" #define __AS_STRING(val) #val #define __CHECK_TRUE(file, line, val, should_exit) \ @@ -68,9 +69,15 @@ //////////////////////////////////////////////////////////////////////////////// // Errno checks. +#ifdef LIBC_TARGET_ARCH_IS_GPU +#define ASSERT_ERRNO_EQ(VAL) +#define ASSERT_ERRNO_SUCCESS() +#define ASSERT_ERRNO_FAILURE() +#else #define ASSERT_ERRNO_EQ(VAL) ASSERT_EQ(VAL, static_cast<int>(errno)) #define ASSERT_ERRNO_SUCCESS() ASSERT_EQ(0, static_cast<int>(errno)) #define ASSERT_ERRNO_FAILURE() ASSERT_NE(0, static_cast<int>(errno)) +#endif // Integration tests are compiled with -ffreestanding which stops treating // the main function as a non-overloadable special function. Hence, we use a |
