Silence -Wnon-power-of-two-alignment for a test
Bug: http://b/214080353
The wrong alignment to aligned_alloc() is deliberate. Silence the
warning around the test.
Test: build with clang-r445002
Change-Id: I73bad7775423c908c2bbe1c550e8ce5aeede129d
diff --git a/libc/malloc_hooks/tests/malloc_hooks_tests.cpp b/libc/malloc_hooks/tests/malloc_hooks_tests.cpp
index 1858781..ca064c2 100644
--- a/libc/malloc_hooks/tests/malloc_hooks_tests.cpp
+++ b/libc/malloc_hooks/tests/malloc_hooks_tests.cpp
@@ -350,6 +350,9 @@
RunTest("*.DISABLED_aligned_alloc_hook_error");
}
+// Allow deliberate call with non-power-of-two alignment in test code.
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wnon-power-of-two-alignment"
TEST_F(MallocHooksTest, DISABLED_aligned_alloc_hook_error) {
Init();
ASSERT_TRUE(__memalign_hook != nullptr);
@@ -365,6 +368,7 @@
EXPECT_FALSE(void_arg_ != nullptr)
<< "The memalign hook was called with a nullptr with an error.";
}
+#pragma clang diagnostic pop
#if !defined(__LP64__)
TEST_F(MallocHooksTest, pvalloc_hook) {