aboutsummaryrefslogtreecommitdiffstats
path: root/include/gtest/internal/gtest-port.h
diff options
context:
space:
mode:
authorkosak <kosak@google.com>2014-03-12 22:55:56 +0000
committerkosak <kosak@google.com>2014-03-12 22:55:56 +0000
commitffea2d604031a8c732cec8f8de9d9f9bcfbbcf70 (patch)
tree173f1b2d67378e24a82d2df3d7a0a2bab447c7dc /include/gtest/internal/gtest-port.h
parentc82282819c0f6fbd2bd025f2326f0a6b104c59b9 (diff)
downloadgoogletest-ffea2d604031a8c732cec8f8de9d9f9bcfbbcf70.tar.gz
googletest-ffea2d604031a8c732cec8f8de9d9f9bcfbbcf70.tar.bz2
googletest-ffea2d604031a8c732cec8f8de9d9f9bcfbbcf70.zip
Add annotations to suppress ThreadSanitizer failures due to gunit/gmock printer.
Diffstat (limited to 'include/gtest/internal/gtest-port.h')
-rw-r--r--include/gtest/internal/gtest-port.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/gtest/internal/gtest-port.h b/include/gtest/internal/gtest-port.h
index a1176760..eaf1a385 100644
--- a/include/gtest/internal/gtest-port.h
+++ b/include/gtest/internal/gtest-port.h
@@ -926,6 +926,18 @@ using ::std::tuple_size;
# define GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
#endif // __clang__
+// A function level attribute to disable ThreadSanitizer instrumentation.
+#if defined(__clang__)
+# if __has_feature(thread_sanitizer)
+# define GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_ \
+ __attribute__((no_sanitize_thread))
+# else
+# define GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_
+# endif // __has_feature(thread_sanitizer)
+#else
+# define GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_
+#endif // __clang__
+
namespace testing {
class Message;