summaryrefslogtreecommitdiffstats
path: root/compiler-rt
diff options
context:
space:
mode:
authorAlexey Samsonov <vonosmas@gmail.com>2015-01-06 20:58:40 +0000
committerAlexey Samsonov <vonosmas@gmail.com>2015-01-06 20:58:40 +0000
commit6239ebc1c2227adb83745d9a7447e243e694a4f1 (patch)
tree2bf26fcf84e55d14350235493e568434ce6ae921 /compiler-rt
parentc8761f4807266f06463e5aaf3953d7bc0e11d759 (diff)
downloadbcm5719-llvm-6239ebc1c2227adb83745d9a7447e243e694a4f1.tar.gz
bcm5719-llvm-6239ebc1c2227adb83745d9a7447e243e694a4f1.zip
[Sanitizer] Improve unit tests in COMPILER_RT_DEBUG=ON mode.
Propagate -DSANITIZER_DEBUG definition to unit tests. Make sure unit tests depend on compiler-rt headers. llvm-svn: 225298
Diffstat (limited to 'compiler-rt')
-rw-r--r--compiler-rt/cmake/Modules/AddCompilerRT.cmake5
-rw-r--r--compiler-rt/cmake/Modules/CompilerRTCompile.cmake2
-rw-r--r--compiler-rt/lib/msan/tests/CMakeLists.txt1
-rw-r--r--compiler-rt/lib/tsan/tests/CMakeLists.txt1
4 files changed, 6 insertions, 3 deletions
diff --git a/compiler-rt/cmake/Modules/AddCompilerRT.cmake b/compiler-rt/cmake/Modules/AddCompilerRT.cmake
index f080fa7d7fe..1904a4be9a1 100644
--- a/compiler-rt/cmake/Modules/AddCompilerRT.cmake
+++ b/compiler-rt/cmake/Modules/AddCompilerRT.cmake
@@ -131,10 +131,11 @@ set(COMPILER_RT_GTEST_CFLAGS
-I${COMPILER_RT_GTEST_PATH}
)
+append_list_if(COMPILER_RT_DEBUG -DSANITIZER_DEBUG=1 COMPILER_RT_TEST_CFLAGS)
+
if(MSVC)
# clang doesn't support exceptions on Windows yet.
- list(APPEND COMPILER_RT_TEST_CFLAGS
- -D_HAS_EXCEPTIONS=0)
+ list(APPEND COMPILER_RT_TEST_CFLAGS -D_HAS_EXCEPTIONS=0)
# We should teach clang to understand "#pragma intrinsic", see PR19898.
list(APPEND COMPILER_RT_TEST_CFLAGS -Wno-undefined-inline)
diff --git a/compiler-rt/cmake/Modules/CompilerRTCompile.cmake b/compiler-rt/cmake/Modules/CompilerRTCompile.cmake
index af3df8ff4f4..de73ccfc5cb 100644
--- a/compiler-rt/cmake/Modules/CompilerRTCompile.cmake
+++ b/compiler-rt/cmake/Modules/CompilerRTCompile.cmake
@@ -9,7 +9,7 @@ macro(clang_compile object_file source)
parse_arguments(SOURCE "CFLAGS;DEPS" "" ${ARGN})
get_filename_component(source_rpath ${source} REALPATH)
if(NOT COMPILER_RT_STANDALONE_BUILD)
- list(APPEND SOURCE_DEPS clang)
+ list(APPEND SOURCE_DEPS clang compiler-rt-headers)
endif()
if (TARGET CompilerRTUnitTestCheckCxx)
list(APPEND SOURCE_DEPS CompilerRTUnitTestCheckCxx)
diff --git a/compiler-rt/lib/msan/tests/CMakeLists.txt b/compiler-rt/lib/msan/tests/CMakeLists.txt
index 53e1b549b70..b7ec0052a0d 100644
--- a/compiler-rt/lib/msan/tests/CMakeLists.txt
+++ b/compiler-rt/lib/msan/tests/CMakeLists.txt
@@ -19,6 +19,7 @@ set(MSAN_UNITTEST_HEADERS
)
set(MSAN_UNITTEST_COMMON_CFLAGS
-I${COMPILER_RT_LIBCXX_PATH}/include
+ ${COMPILER_RT_TEST_CFLAGS}
${COMPILER_RT_GTEST_CFLAGS}
-I${COMPILER_RT_SOURCE_DIR}/include
-I${COMPILER_RT_SOURCE_DIR}/lib
diff --git a/compiler-rt/lib/tsan/tests/CMakeLists.txt b/compiler-rt/lib/tsan/tests/CMakeLists.txt
index 2e830c3be71..cb7e5374ec8 100644
--- a/compiler-rt/lib/tsan/tests/CMakeLists.txt
+++ b/compiler-rt/lib/tsan/tests/CMakeLists.txt
@@ -6,6 +6,7 @@ set_target_properties(TsanUnitTests PROPERTIES
set(TSAN_UNITTEST_CFLAGS
${TSAN_CFLAGS}
+ ${COMPILER_RT_TEST_CFLAGS}
${COMPILER_RT_GTEST_CFLAGS}
-I${COMPILER_RT_SOURCE_DIR}/lib
-I${COMPILER_RT_SOURCE_DIR}/lib/tsan/rtl
OpenPOWER on IntegriCloud