diff options
author | Pirama Arumuga Nainar <pirama@google.com> | 2022-01-28 13:20:27 -0800 |
---|---|---|
committer | Pirama Arumuga Nainar <pirama@google.com> | 2022-01-28 13:27:07 -0800 |
commit | 44dd9facb2f120914971b8f81126f1ca29044b71 (patch) | |
tree | c36b14b51ddd9bb1e2208ef43bdb9b7f42b1b6eb /libc/malloc_hooks/tests/malloc_hooks_tests.cpp | |
parent | 97ec0e312b534b55307f756df3f7954f821a24e9 (diff) |
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
Diffstat (limited to 'libc/malloc_hooks/tests/malloc_hooks_tests.cpp')
-rw-r--r-- | libc/malloc_hooks/tests/malloc_hooks_tests.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libc/malloc_hooks/tests/malloc_hooks_tests.cpp b/libc/malloc_hooks/tests/malloc_hooks_tests.cpp index 18587819a..ca064c2fe 100644 --- a/libc/malloc_hooks/tests/malloc_hooks_tests.cpp +++ b/libc/malloc_hooks/tests/malloc_hooks_tests.cpp @@ -350,6 +350,9 @@ TEST_F(MallocHooksTest, aligned_alloc_hook_error) { 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 @@ TEST_F(MallocHooksTest, DISABLED_aligned_alloc_hook_error) { 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) { |