Skip to content

Commit

Permalink
[clangd] Fix building SerializationTests unit test on OpenBSD
Browse files Browse the repository at this point in the history
This fixes building the unit tests on OpenBSD. OpenBSD does not support RLIMIT_AS.

Reviewed By: kadircet

Differential Revision: https://reviews.llvm.org/D119989
  • Loading branch information
brad0 committed Feb 17, 2022
1 parent 7db1d4d commit f374c8d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions clang-tools-extra/clangd/unittests/SerializationTests.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit f374c8d

Please sign in to comment.