[llvm-commits] [compiler-rt] r163615 - in /compiler-rt/trunk/lib/sanitizer_common: sanitizer_allocator64.h tests/CMakeLists.txt

Alexey Samsonov samsonov at google.com
Tue Sep 11 05:19:18 PDT 2012


Author: samsonov
Date: Tue Sep 11 07:19:18 2012
New Revision: 163615

URL: http://llvm.org/viewvc/llvm-project?rev=163615&view=rev
Log:
[Sanitizer] test 64-bit allocator only on suitable targets

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

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_allocator64.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_allocator64.h?rev=163615&r1=163614&r2=163615&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_allocator64.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_allocator64.h Tue Sep 11 07:19:18 2012
@@ -17,8 +17,12 @@
 #ifndef SANITIZER_ALLOCATOR_H
 #define SANITIZER_ALLOCATOR_H
 
-#include "sanitizer_common.h"
 #include "sanitizer_internal_defs.h"
+#if __WORDSIZE != 64
+# error "sanitizer_allocator64.h can only be used on 64-bit platforms"
+#endif
+
+#include "sanitizer_common.h"
 #include "sanitizer_libc.h"
 #include "sanitizer_list.h"
 #include "sanitizer_mutex.h"

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=163615&r1=163614&r2=163615&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt Tue Sep 11 07:19:18 2012
@@ -1,5 +1,4 @@
 set(SANITIZER_UNITTESTS
-  sanitizer_allocator64_test.cc
   sanitizer_allocator_test.cc
   sanitizer_common_test.cc
   sanitizer_flags_test.cc
@@ -7,6 +6,9 @@
   sanitizer_stackdepot_test.cc
   sanitizer_test_main.cc
   )
+if(CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT LLVM_BUILD_32_BITS)
+  list(APPEND SANITIZER_UNITTESTS sanitizer_allocator64_test.cc)
+endif()
 
 include_directories(..)
 include_directories(../..)





More information about the llvm-commits mailing list