[clang-tools-extra] f374c8d - [clangd] Fix building SerializationTests unit test on OpenBSD
Brad Smith via cfe-commits
cfe-commits at lists.llvm.org
Thu Feb 17 09:17:43 PST 2022
Author: Brad Smith
Date: 2022-02-17T12:17:12-05:00
New Revision: f374c8ddf2dd4920190cac0ea81e18a74040ddda
URL: https://github.com/llvm/llvm-project/commit/f374c8ddf2dd4920190cac0ea81e18a74040ddda
DIFF: https://github.com/llvm/llvm-project/commit/f374c8ddf2dd4920190cac0ea81e18a74040ddda.diff
LOG: [clangd] Fix building SerializationTests unit test on OpenBSD
This fixes building the unit tests on OpenBSD. OpenBSD does not support RLIMIT_AS.
Reviewed By: kadircet
Differential Revision: https://reviews.llvm.org/D119989
Added:
Modified:
clang-tools-extra/clangd/unittests/SerializationTests.cpp
Removed:
################################################################################
diff --git a/clang-tools-extra/clangd/unittests/SerializationTests.cpp b/clang-tools-extra/clangd/unittests/SerializationTests.cpp
index 290e20a082d66..6070b229f31c7 100644
--- a/clang-tools-extra/clangd/unittests/SerializationTests.cpp
+++ b/clang-tools-extra/clangd/unittests/SerializationTests.cpp
@@ -308,9 +308,9 @@ TEST(SerializationTest, CmdlTest) {
}
}
-// rlimit is part of POSIX.
+// rlimit is part of POSIX. RLIMIT_AS does not exist in OpenBSD.
// Sanitizers use a lot of address space, so we can't apply strict limits.
-#if LLVM_ON_UNIX && !LLVM_ADDRESS_SANITIZER_BUILD && \
+#if LLVM_ON_UNIX && defined(RLIMIT_AS) && !LLVM_ADDRESS_SANITIZER_BUILD && \
!LLVM_MEMORY_SANITIZER_BUILD
class ScopedMemoryLimit {
struct rlimit OriginalLimit;
More information about the cfe-commits
mailing list