From 9b681f61b691050d4377646a7629694c5bcee8c1 Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Tue, 18 Nov 2014 21:26:45 +0000 Subject: [PATCH] Add support for LLVM_USE_SANITIZER=Thread llvm-svn: 222259 --- libcxx/CMakeLists.txt | 2 ++ libcxx/test/lit.cfg | 3 +++ 2 files changed, 5 insertions(+) diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt index 5fb0f60ad9d0..f12c5257409d 100644 --- a/libcxx/CMakeLists.txt +++ b/libcxx/CMakeLists.txt @@ -229,6 +229,8 @@ if (LIBCXX_BUILT_STANDALONE) elseif (LLVM_USE_SANITIZER STREQUAL "Undefined") list(APPEND LIBCXX_CXX_FLAGS "-fsanitize=undefined -fno-sanitize=vptr,function -fno-sanitize-recover") + elseif (LLVM_USE_SANITIZER STREQUAL "Thread") + list(APPEND LIBCXX_CXX_FLAGS "-fsanitize=thread") else() message(WARNING "Unsupported value of LLVM_USE_SANITIZER: ${LLVM_USE_SANITIZER}") endif() diff --git a/libcxx/test/lit.cfg b/libcxx/test/lit.cfg index 9098b658b7ac..34875b0fecd6 100644 --- a/libcxx/test/lit.cfg +++ b/libcxx/test/lit.cfg @@ -455,6 +455,9 @@ class Configuration(object): '-fno-sanitize=vptr,function', '-fno-sanitize-recover', '-O3'] self.config.available_features.add('ubsan') + elif san == 'Thread': + self.compile_flags += ['-fsanitize=thread'] + self.config.available_features.add('tsan') else: self.lit_config.fatal('unsupported value for ' 'libcxx_use_san: {0}'.format(san))