summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@verizonmedia.com>2020-05-26 09:57:23 +0200
committerGitHub <noreply@github.com>2020-05-26 09:57:23 +0200
commite9e2e1ce3aab6fcc5d71e6dbfb1a0f99a184f440 (patch)
tree7dd5bd5b6212499b1b63a385e645844bcb1027ae
parente5d6fb2b0c1762f49d123230a43880383def7c7f (diff)
parent8e289f4cc70a8e806bbb36b44ae2b0e9398c0616 (diff)
Merge pull request #13368 from vespa-engine/toregge/detect-clang-version-of-address-sanitizer
Detect use of clang version of address sanitizer.
-rw-r--r--searchlib/src/tests/query/streaming_query_large_test.cpp8
-rw-r--r--vespalib/src/tests/exception_classes/silenceuncaught_test.cpp8
2 files changed, 16 insertions, 0 deletions
diff --git a/searchlib/src/tests/query/streaming_query_large_test.cpp b/searchlib/src/tests/query/streaming_query_large_test.cpp
index a76ec54098e..28401e9d685 100644
--- a/searchlib/src/tests/query/streaming_query_large_test.cpp
+++ b/searchlib/src/tests/query/streaming_query_large_test.cpp
@@ -10,6 +10,14 @@ using namespace search;
using namespace search::query;
using namespace search::streaming;
+#ifndef __SANITIZE_ADDRESS__
+#if defined(__has_feature)
+#if __has_feature(address_sanitizer)
+#define __SANITIZE_ADDRESS__
+#endif
+#endif
+#endif
+
namespace {
void setMaxStackSize(rlim_t maxStackSize)
diff --git a/vespalib/src/tests/exception_classes/silenceuncaught_test.cpp b/vespalib/src/tests/exception_classes/silenceuncaught_test.cpp
index a57dd917ce0..8d81d9e0821 100644
--- a/vespalib/src/tests/exception_classes/silenceuncaught_test.cpp
+++ b/vespalib/src/tests/exception_classes/silenceuncaught_test.cpp
@@ -5,6 +5,14 @@
using namespace vespalib;
+#ifndef __SANITIZE_ADDRESS__
+#if defined(__has_feature)
+#if __has_feature(address_sanitizer)
+#define __SANITIZE_ADDRESS__
+#endif
+#endif
+#endif
+
TEST("that uncaught exception causes negative exitcode.") {
SlaveProc proc("ulimit -c 0 && exec ./vespalib_caught_uncaught_app uncaught");
proc.wait();