[clang-tools-extra] c6d7991 - [clangd] Skip ClangdVFSTest.TestStackOverflow when address sanitizer is used
Bjorn Pettersson via cfe-commits
cfe-commits at lists.llvm.org
Sat Mar 21 03:36:03 PDT 2020
Author: Bjorn Pettersson
Date: 2020-03-21T11:07:45+01:00
New Revision: c6d799156a0a351370dd428bd0fff83d467cec47
URL: https://github.com/llvm/llvm-project/commit/c6d799156a0a351370dd428bd0fff83d467cec47
DIFF: https://github.com/llvm/llvm-project/commit/c6d799156a0a351370dd428bd0fff83d467cec47.diff
LOG: [clangd] Skip ClangdVFSTest.TestStackOverflow when address sanitizer is used
Summary:
The ClangdVFSTest.TestStackOverflow unittest does not seem to work
when building the test with address sanitizer activated. Afaict the
goal is to get a constexpr depth error, rather than stack overflow.
But with asan instrumentation we do get stack overflow complaints
from asan. As a workaround this patch simply disables the test case,
when being built with address sanitizer activated.
Reviewers: sammccall, Dmitry.Kozhevnikov
Reviewed By: sammccall
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits, llvm-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D76533
Added:
Modified:
clang-tools-extra/clangd/unittests/ClangdTests.cpp
Removed:
################################################################################
diff --git a/clang-tools-extra/clangd/unittests/ClangdTests.cpp b/clang-tools-extra/clangd/unittests/ClangdTests.cpp
index 7ac75b8b4e29..1e5fcf3d97e1 100644
--- a/clang-tools-extra/clangd/unittests/ClangdTests.cpp
+++ b/clang-tools-extra/clangd/unittests/ClangdTests.cpp
@@ -1083,6 +1083,9 @@ TEST_F(ClangdVFSTest, FallbackWhenWaitingForCompileCommand) {
Field(&CodeCompletion::Scope, "ns::"))));
}
+// Tests fails when built with asan due to stack overflow. So skip running the
+// test as a workaround.
+#if !defined(__has_feature) || !__has_feature(address_sanitizer)
TEST_F(ClangdVFSTest, TestStackOverflow) {
MockFSProvider FS;
ErrorCheckingCallbacks DiagConsumer;
@@ -1103,6 +1106,7 @@ TEST_F(ClangdVFSTest, TestStackOverflow) {
// overflow
EXPECT_TRUE(DiagConsumer.hadErrorInLastDiags());
}
+#endif
} // namespace
} // namespace clangd
More information about the cfe-commits
mailing list