[ASan] silence various warnings in cmake build of asan unit tests
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@159347 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/asan/tests/CMakeLists.txt b/lib/asan/tests/CMakeLists.txt
index fdc3d82..69dd54c 100644
--- a/lib/asan/tests/CMakeLists.txt
+++ b/lib/asan/tests/CMakeLists.txt
@@ -14,8 +14,9 @@
include_directories(..)
include_directories(../..)
-set(ASAN_UNITTEST_COMMON_CFLAGS
+set(ASAN_UNITTEST_COMMON_CFLAGS
-Wall
+ -Wno-format
-fvisibility=hidden
)
@@ -101,7 +102,7 @@
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/lib/asan/tests/asan_noinst_test.cc b/lib/asan/tests/asan_noinst_test.cc
index f43f99c..4aef960 100644
--- a/lib/asan/tests/asan_noinst_test.cc
+++ b/lib/asan/tests/asan_noinst_test.cc
@@ -329,7 +329,7 @@
}
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 @@
// 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 @@
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/lib/interception/CMakeLists.txt b/lib/interception/CMakeLists.txt
index c0dd0db..033b05f 100644
--- a/lib/interception/CMakeLists.txt
+++ b/lib/interception/CMakeLists.txt
@@ -14,6 +14,9 @@
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)