summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2012-06-28 13:12:07 +0000
committerAlexey Samsonov <samsonov@google.com>2012-06-28 13:12:07 +0000
commit3fe0d4d9aac48708260f1e44e675b30cc3baa304 (patch)
tree95429327f558618bd4da13f3f89dcecebdcddaa2
parentb4edab5a6b4067c82614fdb9ec40597b8d16fa9c (diff)
downloadbcm5719-llvm-3fe0d4d9aac48708260f1e44e675b30cc3baa304.tar.gz
bcm5719-llvm-3fe0d4d9aac48708260f1e44e675b30cc3baa304.zip
[ASan] silence various warnings in cmake build of asan unit tests
llvm-svn: 159347
-rw-r--r--compiler-rt/lib/asan/tests/CMakeLists.txt5
-rw-r--r--compiler-rt/lib/asan/tests/asan_noinst_test.cc10
-rw-r--r--compiler-rt/lib/interception/CMakeLists.txt3
3 files changed, 14 insertions, 4 deletions
diff --git a/compiler-rt/lib/asan/tests/CMakeLists.txt b/compiler-rt/lib/asan/tests/CMakeLists.txt
index fdc3d82ff79..69dd54cdcad 100644
--- a/compiler-rt/lib/asan/tests/CMakeLists.txt
+++ b/compiler-rt/lib/asan/tests/CMakeLists.txt
@@ -14,8 +14,9 @@ include(CheckCXXCompilerFlag)
include_directories(..)
include_directories(../..)
-set(ASAN_UNITTEST_COMMON_CFLAGS
+set(ASAN_UNITTEST_COMMON_CFLAGS
-Wall
+ -Wno-format
-fvisibility=hidden
)
@@ -101,7 +102,7 @@ if("${CMAKE_HOST_SYSTEM}" STREQUAL "${CMAKE_SYSTEM}" AND UNIX)
add_asan_compile_cxx_command(asan_globals_test.cc)
add_asan_compile_cxx_command(asan_test.cc)
- set(ASAN_INSTRUMENTED_TESTS
+ set(ASAN_INSTRUMENTED_TESTS
asan_globals_test.cc.asan.o
asan_test.cc.asan.o
)
diff --git a/compiler-rt/lib/asan/tests/asan_noinst_test.cc b/compiler-rt/lib/asan/tests/asan_noinst_test.cc
index f43f99cf628..4aef9602e9a 100644
--- a/compiler-rt/lib/asan/tests/asan_noinst_test.cc
+++ b/compiler-rt/lib/asan/tests/asan_noinst_test.cc
@@ -329,7 +329,7 @@ TEST(AddressSanitizer, ThreadedOneSizeMallocStressTest) {
}
TEST(AddressSanitizerInterface, GetEstimatedAllocatedSize) {
- EXPECT_EQ(1, __asan_get_estimated_allocated_size(0));
+ EXPECT_EQ(1U, __asan_get_estimated_allocated_size(0));
const size_t sizes[] = { 1, 30, 1<<30 };
for (size_t i = 0; i < 3; i++) {
EXPECT_EQ(sizes[i], __asan_get_estimated_allocated_size(sizes[i]));
@@ -362,7 +362,7 @@ TEST(AddressSanitizerInterface, GetAllocatedSizeAndOwnershipTest) {
// NULL is not owned, but is a valid argument for __asan_get_allocated_size().
EXPECT_EQ(false, __asan_get_ownership(NULL));
- EXPECT_EQ(0, __asan_get_allocated_size(NULL));
+ EXPECT_EQ(0U, __asan_get_allocated_size(NULL));
// When memory is freed, it's not owned, and call to GetAllocatedSize
// is forbidden.
@@ -687,3 +687,9 @@ TEST(AddressSanitizerInterface, GetOwnershipStressTest) {
for (size_t i = 0, n = pointers.size(); i < n; i++)
free(pointers[i]);
}
+
+int main(int argc, char **argv) {
+ testing::GTEST_FLAG(death_test_style) = "threadsafe";
+ testing::InitGoogleTest(&argc, argv);
+ return RUN_ALL_TESTS();
+}
diff --git a/compiler-rt/lib/interception/CMakeLists.txt b/compiler-rt/lib/interception/CMakeLists.txt
index c0dd0dbd159..033b05fc1b3 100644
--- a/compiler-rt/lib/interception/CMakeLists.txt
+++ b/compiler-rt/lib/interception/CMakeLists.txt
@@ -14,6 +14,9 @@ if (APPLE)
endif ()
set(INTERCEPTION_CFLAGS "-fPIC -fno-exceptions -funwind-tables -fvisibility=hidden")
+if (SUPPORTS_NO_VARIADIC_MACROS_FLAG)
+ set(INTERCEPTION_CFLAGS "${INTERCEPTION_CFLAGS} -Wno-variadic-macros")
+endif ()
set(INTERCEPTION_COMMON_DEFINITIONS
INTERCEPTION_HAS_EXCEPTIONS=1)
OpenPOWER on IntegriCloud