Fix TableLookupTest on FreeBSD
authorAndrew Turner <andrew@fubar.geek.nz>
Wed, 18 May 2022 16:21:36 +0000 (17:21 +0100)
committerEd Maste <emaste@FreeBSD.org>
Thu, 9 Jun 2022 13:24:09 +0000 (09:24 -0400)
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

compiler-rt/test/fuzzer/TableLookupTest.cpp

index 247963c..3d02461 100644 (file)
@@ -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