[compiler-rt] 43ba321 - [gwp_asan] Exclude recoverable tests on Fuchsia

Caslyn Tonelli via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 27 14:51:37 PDT 2023


Author: Caslyn Tonelli
Date: 2023-04-27T21:51:30Z
New Revision: 43ba32109657b697c6dd31a30563a66dade5f254

URL: https://github.com/llvm/llvm-project/commit/43ba32109657b697c6dd31a30563a66dade5f254
DIFF: https://github.com/llvm/llvm-project/commit/43ba32109657b697c6dd31a30563a66dade5f254.diff

LOG: [gwp_asan] Exclude recoverable tests on Fuchsia

Signal handlers used by recoverable tests are unsupported on Fuchsia.

Exclude the set of tests that test recoverable code paths (i.e.
BacktraceGuardedPoolAllocator tests in recoverable.cpp) and always set
the `Recoverable` testing bool to `false` on the Fuchsia platform.

Differential Revision: https://reviews.llvm.org/D149311

Added: 
    

Modified: 
    compiler-rt/lib/gwp_asan/tests/backtrace.cpp
    compiler-rt/lib/gwp_asan/tests/harness.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/gwp_asan/tests/backtrace.cpp b/compiler-rt/lib/gwp_asan/tests/backtrace.cpp
index 7cbbcf5fb48ce..6a84a2a4ae5a5 100644
--- a/compiler-rt/lib/gwp_asan/tests/backtrace.cpp
+++ b/compiler-rt/lib/gwp_asan/tests/backtrace.cpp
@@ -21,7 +21,7 @@ TEST_P(BacktraceGuardedPoolAllocatorDeathTest, DoubleFree) {
   DeathRegex.append("was deallocated.*DeallocateMemory[^2].*");
   DeathRegex.append("was allocated.*AllocateMemory");
   if (!Recoverable) {
-    ASSERT_DEATH(DeallocateMemory2(GPA, Ptr), DeathRegex);
+    EXPECT_DEATH(DeallocateMemory2(GPA, Ptr), DeathRegex);
     return;
   }
 
@@ -51,7 +51,7 @@ TEST_P(BacktraceGuardedPoolAllocatorDeathTest, UseAfterFree) {
   DeathRegex.append("was allocated.*AllocateMemory");
 
   if (!Recoverable) {
-    ASSERT_DEATH(TouchMemory(Ptr), DeathRegex);
+    EXPECT_DEATH(TouchMemory(Ptr), DeathRegex);
     return;
   }
 

diff  --git a/compiler-rt/lib/gwp_asan/tests/harness.cpp b/compiler-rt/lib/gwp_asan/tests/harness.cpp
index 6d416300aeafe..4633d3ec6e9ed 100644
--- a/compiler-rt/lib/gwp_asan/tests/harness.cpp
+++ b/compiler-rt/lib/gwp_asan/tests/harness.cpp
@@ -47,8 +47,15 @@ void CheckOnlyOneGwpAsanCrash(const std::string &OutputBuffer) {
       << OutputBuffer;
 }
 
+// Fuchsia does not support recoverable GWP-ASan.
+#if defined(__Fuchsia__)
+INSTANTIATE_TEST_SUITE_P(RecoverableAndNonRecoverableTests,
+                         BacktraceGuardedPoolAllocatorDeathTest,
+                         /* Recoverable */ testing::Values(false));
+#else
 INSTANTIATE_TEST_SUITE_P(RecoverableTests, BacktraceGuardedPoolAllocator,
                          /* Recoverable */ testing::Values(true));
 INSTANTIATE_TEST_SUITE_P(RecoverableAndNonRecoverableTests,
                          BacktraceGuardedPoolAllocatorDeathTest,
                          /* Recoverable */ testing::Bool());
+#endif


        


More information about the llvm-commits mailing list