[compiler-rt] r208697 - [Sanitizer tests] Land the sanitizer twin of the asan-only change r208682

Timur Iskhodzhanov timurrrr at google.com
Tue May 13 06:29:11 PDT 2014


Author: timurrrr
Date: Tue May 13 08:29:11 2014
New Revision: 208697

URL: http://llvm.org/viewvc/llvm-project?rev=208697&view=rev
Log:
[Sanitizer tests] Land the sanitizer twin of the asan-only change r208682

Modified:
    compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt

Modified: compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt?rev=208697&r1=208696&r2=208697&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt Tue May 13 08:29:11 2014
@@ -39,10 +39,32 @@ set(SANITIZER_TEST_CFLAGS_COMMON
   -I${COMPILER_RT_SOURCE_DIR}/lib
   -I${COMPILER_RT_SOURCE_DIR}/lib/sanitizer_common
   -DGTEST_HAS_RTTI=0
-  -O2 -g -fno-rtti
+  -O2
   -Werror=sign-compare
   -Wno-non-virtual-dtor)
 
+append_if(COMPILER_RT_HAS_G_FLAG -g SANITIZER_TEST_CFLAGS_COMMON)
+append_if(COMPILER_RT_HAS_Zi_FLAG -Zi SANITIZER_TEST_CFLAGS_COMMON)
+
+append_if(COMPILER_RT_HAS_FNO_RTTI_FLAG -fno-rtti SANITIZER_TEST_CFLAGS_COMMON)
+append_if(COMPILER_RT_HAS_GR_FLAG -GR- SANITIZER_TEST_CFLAGS_COMMON)
+
+if(MSVC)
+  # System headers and gtest use a lot of deprecated stuff.
+  list(APPEND SANITIZER_TEST_CFLAGS_COMMON
+       -Wno-deprecated-declarations)
+
+  # clang-cl doesn't support exceptions yet.
+  list(APPEND SANITIZER_TEST_CFLAGS_COMMON
+       /fallback
+       -D_HAS_EXCEPTIONS=0)
+
+  # We should teach clang-cl to understand more pragmas.
+  list(APPEND SANITIZER_TEST_CFLAGS_COMMON
+       -Wno-unknown-pragmas
+       -Wno-undefined-inline)
+endif()
+
 append_if(COMPILER_RT_HAS_LIBSTDCXX -lstdc++ SANITIZER_TEST_LINK_FLAGS_COMMON)
 append_if(COMPILER_RT_HAS_LIBDL -ldl SANITIZER_TEST_LINK_FLAGS_COMMON)
 append_if(COMPILER_RT_HAS_LIBPTHREAD -lpthread SANITIZER_TEST_LINK_FLAGS_COMMON)
@@ -69,7 +91,11 @@ function(get_sanitizer_common_lib_for_ar
     set(tgt_name "RTSanitizerCommon.test.${arch}")
   endif()
   set(${lib} "${tgt_name}" PARENT_SCOPE)
-  set(${lib_name} "lib${tgt_name}.a" PARENT_SCOPE)
+  if(NOT MSVC)
+    set(${lib_name} "lib${tgt_name}.a" PARENT_SCOPE)
+  else()
+    set(${lib_name} "${tgt_name}.lib" PARENT_SCOPE)
+  endif()
 endfunction()
 
 # Sanitizer_common unit tests testsuite.





More information about the llvm-commits mailing list