aboutsummaryrefslogtreecommitdiff
path: root/test/fuzzer/OnlySomeBytesTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/fuzzer/OnlySomeBytesTest.cpp')
-rw-r--r--test/fuzzer/OnlySomeBytesTest.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/fuzzer/OnlySomeBytesTest.cpp b/test/fuzzer/OnlySomeBytesTest.cpp
index 05793f0ab..3873b710b 100644
--- a/test/fuzzer/OnlySomeBytesTest.cpp
+++ b/test/fuzzer/OnlySomeBytesTest.cpp
@@ -12,6 +12,7 @@
const size_t N = 2048;
typedef const uint8_t *IN;
+extern "C" {
__attribute__((noinline)) void bad() {
fprintf(stderr, "BINGO\n");
abort();
@@ -27,6 +28,8 @@ __attribute__((noinline)) void fC(IN in) { if (in[2] == 'C') f0(in); }
__attribute__((noinline)) void fB(IN in) { if (in[1] == 'B') fC(in); }
__attribute__((noinline)) void fA(IN in) { if (in[0] == 'A') fB(in); }
+} // extern "C"
+
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
if (Size < N) return 0;
fA((IN)Data);