[clang-tools-extra] ad5a195 - [clangd] Express ASAN interactions of tests more clearly. NFC
Sam McCall via cfe-commits
cfe-commits at lists.llvm.org
Thu Nov 19 11:14:58 PST 2020
Author: Sam McCall
Date: 2020-11-19T20:14:51+01:00
New Revision: ad5a195ae510fbfaf7885549e4899c85f0593fa5
URL: https://github.com/llvm/llvm-project/commit/ad5a195ae510fbfaf7885549e4899c85f0593fa5
DIFF: https://github.com/llvm/llvm-project/commit/ad5a195ae510fbfaf7885549e4899c85f0593fa5.diff
LOG: [clangd] Express ASAN interactions of tests more clearly. NFC
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 c4995cd0de19..f866635283e5 100644
--- a/clang-tools-extra/clangd/unittests/SerializationTests.cpp
+++ b/clang-tools-extra/clangd/unittests/SerializationTests.cpp
@@ -305,7 +305,9 @@ TEST(SerializationTest, CmdlTest) {
}
}
-#if LLVM_ON_UNIX // rlimit is part of POSIX
+// rlimit is part of POSIX.
+// ASan uses a lot of address space, so we can't apply strict limits.
+#if LLVM_ON_UNIX && !LLVM_ADDRESS_SANITIZER_BUILD
class ScopedMemoryLimit {
struct rlimit OriginalLimit;
bool Succeeded = false;
@@ -333,7 +335,6 @@ class ScopedMemoryLimit {
};
#endif
-#ifndef LLVM_ADDRESS_SANITIZER_BUILD
// Test that our deserialization detects invalid array sizes without allocating.
// If this detection fails, the test should allocate a huge array and crash.
TEST(SerializationTest, NoCrashOnBadArraySize) {
@@ -424,7 +425,6 @@ TEST(SerializationTest, NoCrashOnBadStringTableSize) {
EXPECT_THAT(llvm::toString(CorruptParsed.takeError()),
testing::HasSubstr("bytes is implausible"));
}
-#endif
} // namespace
} // namespace clangd
More information about the cfe-commits
mailing list