[clangd] Disable SerializationTest.NoCrashOnBadArraySize with ASAN
authorKirill Bobyrev <kbobyrev@google.com>
Thu, 19 Nov 2020 12:23:43 +0000 (13:23 +0100)
committerKirill Bobyrev <kbobyrev@google.com>
Thu, 19 Nov 2020 12:24:55 +0000 (13:24 +0100)
Address Sanitizer crashes on large allocations:

```c++
// Try to crash rather than hang on large allocation.
ScopedMemoryLimit MemLimit(1000 * 1024 * 1024); // 1GB
```

clang-tools-extra/clangd/unittests/SerializationTests.cpp

index ca7d3ba..68d1d1a 100644 (file)
@@ -332,6 +332,7 @@ public:
 };
 #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) {
@@ -382,6 +383,7 @@ TEST(SerializationTest, NoCrashOnBadArraySize) {
   EXPECT_EQ(llvm::toString(CorruptParsed.takeError()),
             "malformed or truncated include uri");
 }
+#endif
 
 } // namespace
 } // namespace clangd