[compiler-rt] 3e6cfc6 - [NFC][hwasan] Check __GLIBCXX__ before checking _GLIBCXX_RELEASE in test

Hans Wennborg via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 1 00:39:41 PST 2022


Author: Hans Wennborg
Date: 2022-03-01T09:39:26+01:00
New Revision: 3e6cfc631b816144d1ddfb4bb9f84af43367835c

URL: https://github.com/llvm/llvm-project/commit/3e6cfc631b816144d1ddfb4bb9f84af43367835c
DIFF: https://github.com/llvm/llvm-project/commit/3e6cfc631b816144d1ddfb4bb9f84af43367835c.diff

LOG: [NFC][hwasan] Check __GLIBCXX__ before checking _GLIBCXX_RELEASE in test

_GLIBCXX_RELEASE wasn't defined before GCC 7.1.

This is another follow-up to https://reviews.llvm.org/D119161

Added: 
    

Modified: 
    compiler-rt/test/hwasan/TestCases/new-test.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/test/hwasan/TestCases/new-test.cpp b/compiler-rt/test/hwasan/TestCases/new-test.cpp
index d21a80d0de327..7fd20f843d41f 100644
--- a/compiler-rt/test/hwasan/TestCases/new-test.cpp
+++ b/compiler-rt/test/hwasan/TestCases/new-test.cpp
@@ -18,7 +18,9 @@ int main() {
   assert(__sanitizer_get_allocated_size(a1) == 0);
   delete[] a1;
 
-#if defined(__cpp_aligned_new) && (!defined(_GLIBCXX_RELEASE) || _GLIBCXX_RELEASE >= 7)
+#if defined(__cpp_aligned_new) &&                                              \
+    (!defined(__GLIBCXX__) ||                                                  \
+     (defined(_GLIBCXX_RELEASE) && _GLIBCXX_RELEASE >= 7))
   // Aligned new/delete
   constexpr auto kAlign = std::align_val_t{8};
   void *a2 = ::operator new(4, kAlign);


        


More information about the llvm-commits mailing list