[compiler-rt] c1ad5ba - [sanitizer] Fix sanitizer procmap test for FreeBSD

David CARLIER via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 28 05:10:49 PDT 2023


Author: David CARLIER
Date: 2023-08-28T13:10:34+01:00
New Revision: c1ad5bac1613bf4b0fbc557f49a1d90d66c36205

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

LOG: [sanitizer] Fix sanitizer procmap test for FreeBSD

the ParseUnixMemoryProfile makes sense only on platforms which truly support procfs

Reviewers: vitalybuka

Reviewed-By: vitalybuka

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

Added: 
    

Modified: 
    compiler-rt/lib/sanitizer_common/tests/sanitizer_procmaps_test.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/sanitizer_common/tests/sanitizer_procmaps_test.cpp b/compiler-rt/lib/sanitizer_common/tests/sanitizer_procmaps_test.cpp
index 36c393f74cfb89..00542b944f516d 100644
--- a/compiler-rt/lib/sanitizer_common/tests/sanitizer_procmaps_test.cpp
+++ b/compiler-rt/lib/sanitizer_common/tests/sanitizer_procmaps_test.cpp
@@ -25,7 +25,7 @@ extern const char *argv0;
 
 namespace __sanitizer {
 
-#if SANITIZER_LINUX && !SANITIZER_ANDROID
+#  if SANITIZER_LINUX && !SANITIZER_ANDROID
 TEST(MemoryMappingLayout, CodeRange) {
   uptr start, end;
   bool res = GetCodeRangeForFile("[vdso]", &start, &end);
@@ -33,7 +33,7 @@ TEST(MemoryMappingLayout, CodeRange) {
   EXPECT_GT(start, 0U);
   EXPECT_LT(start, end);
 }
-#endif
+#  endif
 
 TEST(MemoryMappingLayout, DumpListOfModules) {
   const char *last_slash = strrchr(argv0, '/');
@@ -69,7 +69,8 @@ TEST(MemoryMapping, LoadedModuleArchAndUUID) {
       if (SANITIZER_WORDSIZE == 32) {
         EXPECT_EQ(arch, kModuleArchI386);
       } else if (SANITIZER_WORDSIZE == 64) {
-        EXPECT_TRUE(arch == kModuleArchX86_64 || arch == kModuleArchX86_64H || arch == kModuleArchARM64);
+        EXPECT_TRUE(arch == kModuleArchX86_64 || arch == kModuleArchX86_64H ||
+                    arch == kModuleArchARM64);
       }
       const u8 *uuid = modules[i].uuid();
       u8 null_uuid[kModuleUUIDSize] = {0};
@@ -78,8 +79,7 @@ TEST(MemoryMapping, LoadedModuleArchAndUUID) {
   }
 }
 
-#  if (SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_NETBSD || \
-       SANITIZER_SOLARIS) &&                                       \
+#  if (SANITIZER_LINUX || SANITIZER_NETBSD || SANITIZER_SOLARIS) && \
       defined(_LP64)
 const char *const parse_unix_input = R"(
 7fb9862f1000-7fb9862f3000 rw-p 00000000 00:00 0 


        


More information about the llvm-commits mailing list