[libc][nacl-ported-tests] Also check for hwasan in TestPosixMemAlign
An alignment failure is expected for this test when calling
posix_memalign. This is normally caught in asan, but hwasan also catches
this, so we should ignore this for hwasan as well.
Change-Id: I75537b50560364d74aa2c0d03e7c84ff1c14c6c7
Reviewed-on: https://fuchsia-review.googlesource.com/c/libc-tests/+/1069481
Commit-Queue: Leonard Chan <leonardchan@google.com>
Reviewed-by: Roland McGrath <mcgrathr@google.com>
diff --git a/third_party/nacl-ported-tests/libc/posix_memalign.cc b/third_party/nacl-ported-tests/libc/posix_memalign.cc
index a7c32fd..4b1fdfe 100644
--- a/third_party/nacl-ported-tests/libc/posix_memalign.cc
+++ b/third_party/nacl-ported-tests/libc/posix_memalign.cc
@@ -62,7 +62,7 @@
// as errors and causes the entire test binary to exit. We can still test
// these on non ASan builds but for ASan builds we should avoid testing
// them.
-#if !__has_feature(address_sanitizer)
+#if !__has_feature(address_sanitizer) && !__has_feature(hwaddress_sanitizer)
/* Check that a non-power of 2 alignment fails. */
ASSERT_EQ(posix_memalign((void**)&outp, 7, 20 * sizeof(char)), EINVAL)
<< "posix_memaligned failed to return EINVAL for non-pow2!";