[compiler-rt] 95141aa - Fix TableLookupTest on FreeBSD

Ed Maste via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 9 06:24:25 PDT 2022


Author: Andrew Turner
Date: 2022-06-09T09:24:09-04:00
New Revision: 95141aa9cbb1f5f655ed84dd280ef7314b750477

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

LOG: Fix TableLookupTest on FreeBSD

As with Linux placce the Counters array in the __libfuzzer_extra_counters
section. This fixes the test on FreeBSD.

Reviewed by: vitalybuka

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

Added: 
    

Modified: 
    compiler-rt/test/fuzzer/TableLookupTest.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/test/fuzzer/TableLookupTest.cpp b/compiler-rt/test/fuzzer/TableLookupTest.cpp
index 247963cca698e..3d0246138264c 100644
--- a/compiler-rt/test/fuzzer/TableLookupTest.cpp
+++ b/compiler-rt/test/fuzzer/TableLookupTest.cpp
@@ -22,7 +22,7 @@ const size_t N = 1 << 12;
 // Use either `Counters[Idx] = 1` or `Counters[Idx]++;`
 // depending on whether multiple occurrences of the event 'Idx'
 // is important to distinguish from one occurrence.
-#ifdef __linux__
+#if defined(__linux__) || defined(__FreeBSD__)
 __attribute__((section("__libfuzzer_extra_counters")))
 #endif
 #ifdef _WIN32


        


More information about the llvm-commits mailing list