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

(cherry picked from commit f374c8d)
  • Loading branch information
brad0 authored and tstellar committed Feb 21, 2022
1 parent 13fdc7a commit fef110b
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 fef110b

Please sign in to comment.